diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 01f508e3e..1885894af 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -131,8 +131,8 @@ define([ this.rightmenu.fireEvent('editcomplete', this.rightmenu); }, - onFocusObject: function(SelectedObjects) { - if (!this.editMode) + onFocusObject: function(SelectedObjects, forceSignature) { + if (!this.editMode && !forceSignature) return; var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false; @@ -269,6 +269,7 @@ define([ if (priorityactive>-1) active = priorityactive; else if (lastactive>=0 && currentactive<0) active = lastactive; else if (currentactive>=0) active = currentactive; + else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature; else if (!this._settings[Common.Utils.documentSettingsType.MailMerge].hidden) active = Common.Utils.documentSettingsType.MailMerge; if (active == undefined && open && lastactive>=0) @@ -423,8 +424,9 @@ define([ } this.rightmenu.chartSettings.disableControls(disabled); - if (!allowSignature && this.rightmenu.signatureSettings) { - this.rightmenu.btnSignature.setDisabled(disabled); + if (this.rightmenu.signatureSettings) { + !allowSignature && this.rightmenu.btnSignature.setDisabled(disabled); + allowSignature && disabled && this.onFocusObject([], true); // force press signature button } if (disabled) { diff --git a/apps/documenteditor/main/app/view/SignatureSettings.js b/apps/documenteditor/main/app/view/SignatureSettings.js index c489c8e13..8b087ba4e 100644 --- a/apps/documenteditor/main/app/view/SignatureSettings.js +++ b/apps/documenteditor/main/app/view/SignatureSettings.js @@ -400,7 +400,7 @@ define([ allowMerge: false, allowSignature: true, allowProtect: true, - rightMenu: {clear: disable && (DE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true}, + rightMenu: {clear: false, disable: true}, statusBar: true, leftMenu: {disable: false, previewMode: true}, fileMenu: false, diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index c6f83d14a..8d6791d91 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -106,8 +106,8 @@ define([ this.rightmenu.fireEvent('editcomplete', this.rightmenu); }, - onFocusObject: function(SelectedObjects) { - if (!this.editMode) + onFocusObject: function(SelectedObjects, forceSignature) { + if (!this.editMode && !forceSignature) return; var open = this._initSettings ? !Common.localStorage.getBool("pe-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false; @@ -194,6 +194,7 @@ define([ if (priorityactive>-1) active = priorityactive; else if (currentactive>=0) active = currentactive; else if (lastactive>=0) active = lastactive; + else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature; else active = Common.Utils.documentSettingsType.Slide; if (active !== undefined) { @@ -226,8 +227,9 @@ define([ this.rightmenu.imageSettings.disableControls(disabled); this.rightmenu.chartSettings.disableControls(disabled); - if (!allowSignature && this.rightmenu.signatureSettings) { - this.rightmenu.btnSignature.setDisabled(disabled); + if (this.rightmenu.signatureSettings) { + !allowSignature && this.rightmenu.btnSignature.setDisabled(disabled); + allowSignature && disabled && this.onFocusObject([], true); // force press signature button } if (disabled) { diff --git a/apps/presentationeditor/main/app/view/SignatureSettings.js b/apps/presentationeditor/main/app/view/SignatureSettings.js index c92af3468..2360de436 100644 --- a/apps/presentationeditor/main/app/view/SignatureSettings.js +++ b/apps/presentationeditor/main/app/view/SignatureSettings.js @@ -350,7 +350,7 @@ define([ Common.NotificationCenter.trigger('editing:disable', disable, { viewMode: disable, allowSignature: true, - rightMenu: {clear: disable && (PE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true}, + rightMenu: {clear: false, disable: true}, statusBar: true, leftMenu: {disable: false, previewMode: true}, fileMenu: false, diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index be2acfa89..00bcf8923 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -168,14 +168,14 @@ define([ this.onFocusObject(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo); }, - onFocusObject: function(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo) { - if (!this.editMode) + onFocusObject: function(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo, forceSignature) { + if (!this.editMode && !forceSignature) return; - var isCellLocked = cellInfo.asc_getLocked() || this._state.wsProps['FormatCells'], - isTableLocked = (cellInfo.asc_getLockedTable()===true || !this.rightmenu.mode.canModifyFilter) || this._state.wsProps['FormatCells'], - isSparkLocked = (cellInfo.asc_getLockedSparkline()===true) || this._state.wsLock, - isPivotLocked = (cellInfo.asc_getLockedPivotTable()===true) || this._state.wsProps['PivotTables']; + var isCellLocked = cellInfo && cellInfo.asc_getLocked() || this._state.wsProps['FormatCells'], + isTableLocked = (cellInfo && cellInfo.asc_getLockedTable()===true || !this.rightmenu.mode.canModifyFilter) || this._state.wsProps['FormatCells'], + isSparkLocked = (cellInfo && cellInfo.asc_getLockedSparkline()===true) || this._state.wsLock, + isPivotLocked = (cellInfo && cellInfo.asc_getLockedPivotTable()===true) || this._state.wsProps['PivotTables']; for (var i=0; i-1) active = priorityactive; else if (lastactive>=0 && currentactive<0) active = lastactive; else if (currentactive>=0) active = currentactive; + else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature; if (active == undefined && this._openRightMenu && lastactive>=0) active = lastactive; @@ -425,12 +426,9 @@ define([ this.rightmenu.cellSettings.disableControls(disabled); this.rightmenu.slicerSettings.disableControls(disabled); - if (!allowSignature && this.rightmenu.signatureSettings) { - this.rightmenu.btnSignature.setDisabled(disabled); - } - - if (!allowSignature && this.rightmenu.signatureSettings) { - this.rightmenu.btnSignature.setDisabled(disabled); + if (this.rightmenu.signatureSettings) { + !allowSignature && this.rightmenu.btnSignature.setDisabled(disabled); + allowSignature && disabled && this.onFocusObject([], undefined, undefined, undefined, undefined, true); // force press signature button } if (disabled) { diff --git a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js index 53836c5ac..e80268fee 100644 --- a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js +++ b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js @@ -397,7 +397,7 @@ define([ viewMode: disable, allowSignature: true, allowProtect: true, - rightMenu: {clear: disable && (SSE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true}, + rightMenu: {clear: false, disable: true}, statusBar: true, leftMenu: {disable: false, previewMode: true}, fileMenu: false,