From fadcbc36e6fad5cdab4232c7fcb37f79635c7d7f Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Fri, 20 Feb 2026 10:40:29 +0300 Subject: [PATCH] [PDFE PE SSE] Resize for right panel --- .../pdfeditor/main/app/controller/Viewport.js | 14 +++++++++-- apps/pdfeditor/main/app/view/RightMenu.js | 23 ++++++++++++++++--- apps/pdfeditor/main/app/view/Viewport.js | 9 +++++++- .../main/app/controller/Viewport.js | 14 +++++++++-- .../main/app/view/RightMenu.js | 21 +++++++++++++++-- .../main/app/view/Viewport.js | 9 +++++++- .../main/app/controller/Viewport.js | 14 +++++++++-- .../main/app/view/RightMenu.js | 21 +++++++++++++++-- .../main/app/view/Viewport.js | 9 +++++++- 9 files changed, 118 insertions(+), 16 deletions(-) diff --git a/apps/pdfeditor/main/app/controller/Viewport.js b/apps/pdfeditor/main/app/controller/Viewport.js index b248b3e443..43d23e6520 100644 --- a/apps/pdfeditor/main/app/controller/Viewport.js +++ b/apps/pdfeditor/main/app/controller/Viewport.js @@ -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'); diff --git a/apps/pdfeditor/main/app/view/RightMenu.js b/apps/pdfeditor/main/app/view/RightMenu.js index c36ee2832d..43bdf95014 100644 --- a/apps/pdfeditor/main/app/view/RightMenu.js +++ b/apps/pdfeditor/main/app/view/RightMenu.js @@ -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', diff --git a/apps/pdfeditor/main/app/view/Viewport.js b/apps/pdfeditor/main/app/view/Viewport.js index c3ef7bdccb..aafafd29c3 100644 --- a/apps/pdfeditor/main/app/view/Viewport.js +++ b/apps/pdfeditor/main/app/view/Viewport.js @@ -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 + } } ]; diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 6c5434d23d..9cf24d732f 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -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'); diff --git a/apps/presentationeditor/main/app/view/RightMenu.js b/apps/presentationeditor/main/app/view/RightMenu.js index 43f8239141..ab8024a1fe 100644 --- a/apps/presentationeditor/main/app/view/RightMenu.js +++ b/apps/presentationeditor/main/app/view/RightMenu.js @@ -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'); }, diff --git a/apps/presentationeditor/main/app/view/Viewport.js b/apps/presentationeditor/main/app/view/Viewport.js index 49cc948c30..1b40a2bed0 100644 --- a/apps/presentationeditor/main/app/view/Viewport.js +++ b/apps/presentationeditor/main/app/view/Viewport.js @@ -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() ) { diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 7215778fcb..e680fdcc8b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -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'); diff --git a/apps/spreadsheeteditor/main/app/view/RightMenu.js b/apps/spreadsheeteditor/main/app/view/RightMenu.js index 763d36ee3c..982aa71222 100644 --- a/apps/spreadsheeteditor/main/app/view/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/view/RightMenu.js @@ -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'); }, diff --git a/apps/spreadsheeteditor/main/app/view/Viewport.js b/apps/spreadsheeteditor/main/app/view/Viewport.js index 18fb2caa47..4899cd81f9 100644 --- a/apps/spreadsheeteditor/main/app/view/Viewport.js +++ b/apps/spreadsheeteditor/main/app/view/Viewport.js @@ -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() ) {