Skip to content

Commit

Permalink
[DE PE SSE] Fix plugin panels width, fix plugins resize
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaSvinareva committed Dec 4, 2023
1 parent 7d84d9f commit 1c54ff2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions apps/common/main/lib/controller/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ define([
var guid = plugin.get_Guid(),
langName = plugin.get_Name(lang),
menu = this.isPDFEditor ? 'left' : variation.get_Menu();
!menu && (menu = 'left');
this.addPluginToSideMenu(plugin, langName, menu);
if (!this.viewPlugins.pluginPanels[guid].openInsideMode(langName, url, frameId, plugin.get_Guid()))
this.api.asc_pluginButtonClick(-1, plugin.get_Guid());
Expand Down
5 changes: 1 addition & 4 deletions apps/common/main/resources/less/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ label {
}

.right-panel {
min-width: 220px;
max-width: 260px;
width: 220px;
height: 100%;
display: none;
//padding: 0 10px 0 15px;
Expand Down Expand Up @@ -215,7 +214,6 @@ label {

.settings-panel {
display: none;
width: 220px;
overflow: visible;
margin-top: 7px;
padding: 0 10px 0 15px;
Expand Down Expand Up @@ -286,7 +284,6 @@ label {

.plugin-panel {
display: none;
width: 260px;
&.active {
display: block;
}
Expand Down
12 changes: 4 additions & 8 deletions apps/documenteditor/main/app/view/RightMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

var SCALE_MIN = 40;
var MENU_SCALE_PART = 260;
var MENU_MAX_SCALE_PART = 300;

define([
'text!documenteditor/main/app/template/RightMenu.template',
Expand Down Expand Up @@ -289,20 +288,18 @@ define([
},

onBtnMenuClick: function(btn, e) {
var target_pane,
var isPlugin = btn && btn.options.type === 'plugin',
target_pane_parent = $(this.el).find('.right-panel'),
isPlugin = btn && btn.options.type === 'plugin',
width = !isPlugin ? MENU_SCALE_PART : MENU_MAX_SCALE_PART;
target_pane;
if (btn && !isPlugin) {
target_pane = $("#" + this._settings[btn.options.asctype].panel);
}

if (btn && btn.pressed) {
if ( this.minimizedMode || (!isPlugin && this.maximizedMode) || (isPlugin && !this.maximizedMode) ) {
$(this.el).width(width);
if ( this.minimizedMode ) {
$(this.el).width(MENU_SCALE_PART);
target_pane_parent.css("display", "inline-block" );
this.minimizedMode = false;
this.maximizedMode = isPlugin;
Common.localStorage.setItem("de-hide-right-settings", 0);
Common.Utils.InternalSettings.set("de-hide-right-settings", false);
}
Expand All @@ -316,7 +313,6 @@ define([
target_pane_parent.css("display", "none" );
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
this.maximizedMode = false;
Common.localStorage.setItem("de-hide-right-settings", 1);
Common.Utils.InternalSettings.set("de-hide-right-settings", true);
}
Expand Down

0 comments on commit 1c54ff2

Please sign in to comment.