Merge pull request #1552 from ONLYOFFICE/fix/de-right-panel

Fix/de right panel
This commit is contained in:
Julia Radzhabova 2022-02-10 19:37:21 +03:00 committed by GitHub
commit 0d1bf63050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

View file

@ -788,7 +788,7 @@ define([
allowMerge: false,
allowSignature: false,
allowProtect: false,
rightMenu: {clear: true, disable: true},
rightMenu: {clear: disable, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: {protect: true},

View file

@ -306,7 +306,7 @@ define([
allowMerge: false,
allowSignature: false,
allowProtect: false,
rightMenu: {clear: true, disable: true},
rightMenu: {clear: disable, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: false,

View file

@ -131,11 +131,15 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects, forceSignature) {
onApiFocusObject: function(SelectedObjects) {
this.onFocusObject(SelectedObjects);
},
onFocusObject: function(SelectedObjects, forceSignature, forceOpen) {
if (!this.editMode && !forceSignature)
return;
var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false;
var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : !!forceOpen;
this._initSettings = false;
var can_add_table = false,
@ -339,7 +343,7 @@ define([
createDelayedElements: function() {
var me = this;
if (this.api) {
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this));
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this));
if (this.rightmenu.mergeSettings) {
this.rightmenu.mergeSettings.setDocumentName(this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption());
@ -443,7 +447,7 @@ define([
} else {
var selectedElements = this.api.getSelectedElements();
if (selectedElements.length > 0)
this.onFocusObject(selectedElements);
this.onFocusObject(selectedElements, false, !Common.Utils.InternalSettings.get("de-hide-right-settings"));
}
}
},

View file

@ -151,6 +151,7 @@ define([
this.defaultHideRightMenu = mode.customization && !!mode.customization.hideRightMenu;
var open = !Common.localStorage.getBool("de-hide-right-settings", this.defaultHideRightMenu);
Common.Utils.InternalSettings.set("de-hide-right-settings", !open);
this.$el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px');
this.$el.show();
@ -279,6 +280,7 @@ define([
target_pane_parent.css("display", "inline-block" );
this.minimizedMode = false;
Common.localStorage.setItem("de-hide-right-settings", 0);
Common.Utils.InternalSettings.set("de-hide-right-settings", false);
}
target_pane_parent.find('> .active').removeClass('active');
target_pane.addClass("active");
@ -291,6 +293,7 @@ define([
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
Common.localStorage.setItem("de-hide-right-settings", 1);
Common.Utils.InternalSettings.set("de-hide-right-settings", true);
}
this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode, e]);