[PDFE PE SSE] Resize for right panel

This commit is contained in:
Alexey Koshelev
2026-02-20 10:40:29 +03:00
parent 8577adba96
commit fadcbc36e6
9 changed files with 118 additions and 16 deletions

View File

@ -155,10 +155,20 @@ define([
$(window).on('resize', _.bind(this.onWindowResize, this));
var leftPanel = $('#left-menu'),
histPanel = $('#left-panel-history');
histPanel = $('#left-panel-history'),
rightPanel = $('#right-menu');
this.viewport.hlayout.on('layout:resizedrag', function() {
this.api.Resize();
Common.localStorage.setItem('pdfe-mainmenu-width', histPanel.is(':visible') ? (histPanel.width()+SCALE_MIN) : leftPanel.width() );
const leftPanelWidth = histPanel.is(':visible') ? (histPanel.width()+SCALE_MIN) : leftPanel.width();
if(leftPanelWidth > SCALE_MIN) {
Common.localStorage.setItem('pdfe-mainmenu-width', leftPanelWidth);
}
const rightPanelWidth = rightPanel.width();
if(rightPanelWidth > SCALE_MIN) {
Common.localStorage.setItem('pdfe-rightmenu-width', rightPanelWidth);
}
}, this);
this.boxSdk = $('#editor_sdk');

View File

@ -277,6 +277,17 @@ define([
target_pane_parent.find('.content-box > .active').removeClass('active');
target_pane && target_pane.addClass("active");
const viewport = PDFE.getController('Viewport').getView('Viewport');
viewport.hlayout.hideItemResizer('right', !isPlugin);
const widthFromStorage = Common.localStorage.getItem('pdfe-rightmenu-width');
if(isPlugin && widthFromStorage) {
this.$el.width(parseInt(widthFromStorage));
} else {
this.setInnerWidth(MENU_BASE_WIDTH);
}
Common.NotificationCenter.trigger('layout:changed', 'rightmenu');
if (this.scroller) {
this.scroller.scrollTop(0);
}
@ -346,12 +357,18 @@ define([
this.$el.find('.side-panel .content-box').append($panel);
},
setInnerWidth: function(value) {
const pane = $(this.el).find('.right-panel');
const paddings = parseInt(pane.css('padding-left')) + parseInt(pane.css('padding-right'));
MENU_SCALE_PART = value + paddings;
this.$el.css('width', (!Common.Utils.InternalSettings.get("pdfe-hide-right-settings") ? MENU_SCALE_PART : SCALE_MIN) + 'px');
},
updateWidth: function() {
var pane = $(this.el).find('.right-panel'),
paddings = parseInt(pane.css('padding-left')) + parseInt(pane.css('padding-right'));
pane.css('width', MENU_BASE_WIDTH + paddings + 'px');
MENU_SCALE_PART = SCALE_MIN + MENU_BASE_WIDTH + paddings;
this.$el.css('width', (this.GetActivePane() ? MENU_SCALE_PART : SCALE_MIN) + 'px');
MENU_SCALE_PART = MENU_BASE_WIDTH + paddings;
this.$el.css('width', (!Common.Utils.InternalSettings.get("pdfe-hide-right-settings") ? MENU_SCALE_PART : SCALE_MIN) + 'px');
},
txtParagraphSettings: 'Text Settings',

View File

@ -127,7 +127,14 @@ define([
stretch: true
}, {
el: $(items[2]).hide(),
rely: true
rely: true,
alias: 'right',
resize: {
hidden: false,
autohide: false,
min: -600,
max: -260
}
}
];

View File

@ -149,10 +149,20 @@ define([
$(window).on('resize', _.bind(this.onWindowResize, this));
var leftPanel = $('#left-menu'),
histPanel = $('#left-panel-history');
histPanel = $('#left-panel-history'),
rightPanel = $('#right-menu');
this.viewport.hlayout.on('layout:resizedrag', function() {
this.api.Resize();
Common.localStorage.setItem('pe-mainmenu-width', histPanel.is(':visible') ? (histPanel.width()+SCALE_MIN) : leftPanel.width() );
const leftPanelWidth = histPanel.is(':visible') ? (histPanel.width()+SCALE_MIN) : leftPanel.width();
if(leftPanelWidth > SCALE_MIN) {
Common.localStorage.setItem('pe-mainmenu-width', leftPanelWidth);
}
const rightPanelWidth = rightPanel.width();
if(rightPanelWidth > SCALE_MIN) {
Common.localStorage.setItem('pe-rightmenu-width', rightPanelWidth);
}
}, this);
this.boxSdk = $('#editor_sdk');

View File

@ -281,6 +281,17 @@ define([
target_pane_parent.find('.content-box > .active').removeClass('active');
target_pane && target_pane.addClass("active");
const viewport = PE.getController('Viewport').getView('Viewport');
viewport.hlayout.hideItemResizer('right', !isPlugin);
const widthFromStorage = Common.localStorage.getItem('pe-rightmenu-width');
if(isPlugin && widthFromStorage) {
this.$el.width(parseInt(widthFromStorage));
} else {
this.setInnerWidth(MENU_BASE_WIDTH);
}
Common.NotificationCenter.trigger('layout:changed', 'rightmenu');
if (this.scroller) {
this.scroller.scrollTop(0);
}
@ -355,11 +366,17 @@ define([
this.$el.find('.side-panel .content-box').append($panel);
},
setInnerWidth: function(value) {
const pane = $(this.el).find('.right-panel');
const paddings = parseInt(pane.css('padding-left')) + parseInt(pane.css('padding-right'));
MENU_SCALE_PART = value + paddings;
this.$el.css('width', (!Common.Utils.InternalSettings.get("pe-hide-right-settings") ? MENU_SCALE_PART : SCALE_MIN) + 'px');
},
updateWidth: function() {
var pane = $(this.el).find('.right-panel'),
paddings = parseInt(pane.css('padding-left')) + parseInt(pane.css('padding-right'));
pane.css('width', MENU_BASE_WIDTH + paddings + 'px');
MENU_SCALE_PART = SCALE_MIN + MENU_BASE_WIDTH + paddings;
MENU_SCALE_PART = MENU_BASE_WIDTH + paddings;
this.$el.css('width', (!Common.Utils.InternalSettings.get("pe-hide-right-settings") ? MENU_SCALE_PART : SCALE_MIN) + 'px');
},

View File

@ -131,7 +131,14 @@ define([
stretch: true
}, {
el: $(items[2]).hide(),
rely: true
rely: true,
alias: 'right',
resize: {
hidden: false,
autohide: false,
min: -600,
max: -260
}
}];
if ( Common.UI.isRTL() ) {

View File

@ -211,10 +211,20 @@ define([
}, this);
var leftPanel = $('#left-menu'),
histPanel = $('#left-panel-history');
histPanel = $('#left-panel-history'),
rightPanel = $('#right-menu');
this.viewport.hlayout.on('layout:resizedrag', function() {
this.api.asc_Resize();
Common.localStorage.setItem('sse-mainmenu-width',histPanel.is(':visible') ? (histPanel.width()+SCALE_MIN) : leftPanel.width());
const leftPanelWidth = histPanel.is(':visible') ? (histPanel.width()+SCALE_MIN) : leftPanel.width();
if(leftPanelWidth > SCALE_MIN) {
Common.localStorage.setItem('sse-mainmenu-width', leftPanelWidth);
}
const rightPanelWidth = rightPanel.width();
if(rightPanelWidth > SCALE_MIN) {
Common.localStorage.setItem('sse-rightmenu-width', rightPanelWidth);
}
}, this);
this.boxSdk = $('#editor_sdk');

View File

@ -298,6 +298,17 @@ define([
target_pane_parent.find('.content-box > .active').removeClass('active');
target_pane && target_pane.addClass("active");
const viewport = SSE.getController('Viewport').getView('Viewport');
viewport.hlayout.hideItemResizer('right', !isPlugin);
const widthFromStorage = Common.localStorage.getItem('sse-rightmenu-width');
if(isPlugin && widthFromStorage) {
this.$el.width(parseInt(widthFromStorage));
} else {
this.setInnerWidth(MENU_BASE_WIDTH);
}
Common.NotificationCenter.trigger('layout:changed', 'rightmenu');
if (this.scroller) {
this.scroller.scrollTop(0);
}
@ -367,11 +378,17 @@ define([
this.$el.find('.side-panel .content-box').append($panel);
},
setInnerWidth: function(value) {
const pane = $(this.el).find('.right-panel');
const paddings = parseInt(pane.css('padding-left')) + parseInt(pane.css('padding-right'));
MENU_SCALE_PART = value + paddings;
this.$el.css('width', (!Common.Utils.InternalSettings.get("sse-hide-right-settings") ? MENU_SCALE_PART : SCALE_MIN) + 'px');
},
updateWidth: function() {
var pane = $(this.el).find('.right-panel'),
paddings = parseInt(pane.css('padding-left')) + parseInt(pane.css('padding-right'));
pane.css('width', MENU_BASE_WIDTH + paddings + 'px');
MENU_SCALE_PART = SCALE_MIN + MENU_BASE_WIDTH + paddings;
MENU_SCALE_PART = MENU_BASE_WIDTH + paddings;
this.$el.css('width', (!Common.Utils.InternalSettings.get("sse-hide-right-settings") ? MENU_SCALE_PART : SCALE_MIN) + 'px');
},

View File

@ -134,7 +134,14 @@ define([
stretch: true
}, {
el: $(items[2]).hide(),
rely: true
rely: true,
alias: 'right',
resize: {
hidden: false,
autohide: false,
min: -600,
max: -260
}
}];
if ( Common.UI.isRTL() ) {