From 900ffe6f33d1815ca917c2e0b506def988d7210b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 11 Nov 2020 17:46:13 +0300 Subject: [PATCH] [DE][PE] Fix bug with right panel --- apps/documenteditor/main/app/controller/RightMenu.js | 8 ++++++-- apps/presentationeditor/main/app/controller/RightMenu.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index bdba2ff6e..7c0ae2dc6 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -53,6 +53,7 @@ define([ initialize: function() { this.editMode = true; + this._initSettings = true; this.addListeners({ 'RightMenu': { @@ -106,10 +107,13 @@ define([ this.rightmenu.fireEvent('editcomplete', this.rightmenu); }, - onFocusObject: function(SelectedObjects, open) { + onFocusObject: function(SelectedObjects) { if (!this.editMode) return; + var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false; + this._initSettings = false; + var can_add_table = false, in_equation = false, needhide = true; @@ -280,7 +284,7 @@ define([ // this.rightmenu.shapeSettings.createDelayedElements(); var selectedElements = this.api.getSelectedElements(); if (selectedElements.length>0) { - this.onFocusObject(selectedElements, !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu)); + this.onFocusObject(selectedElements); } } }, diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index 8198f2fe1..bcc18943f 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -55,6 +55,7 @@ define([ initialize: function() { this.editMode = true; this._state = {no_slides: undefined}; + this._initSettings = true; this.addListeners({ 'RightMenu': { @@ -105,10 +106,13 @@ define([ this.rightmenu.fireEvent('editcomplete', this.rightmenu); }, - onFocusObject: function(SelectedObjects, open) { + onFocusObject: function(SelectedObjects) { if (!this.editMode) return; + var open = this._initSettings ? !Common.localStorage.getBool("pe-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false; + this._initSettings = false; + var needhide = true; for (var i=0; i0) { - this.onFocusObject(selectedElements, !Common.localStorage.getBool("pe-hide-right-settings", this.rightmenu.defaultHideRightMenu)); + this.onFocusObject(selectedElements); } } },