From 62ad6c74add62d33d04879702c52159759abae2b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 8 Feb 2024 18:27:08 +0300 Subject: [PATCH 1/5] Add Close button to editor header. --- apps/api/documents/api.js | 6 +++- apps/common/main/lib/view/Header.js | 18 +++++++++++- .../main/app/controller/LeftMenu.js | 1 + .../main/app/controller/Main.js | 29 +++++++++++++++---- apps/documenteditor/main/app/view/FileMenu.js | 16 +++++++++- apps/documenteditor/main/locale/en.json | 2 ++ .../pdfeditor/main/app/controller/LeftMenu.js | 1 + apps/pdfeditor/main/app/controller/Main.js | 29 +++++++++++++++---- apps/pdfeditor/main/app/view/FileMenu.js | 16 +++++++++- apps/pdfeditor/main/locale/en.json | 2 ++ .../main/app/controller/LeftMenu.js | 1 + .../main/app/controller/Main.js | 29 +++++++++++++++---- .../main/app/view/FileMenu.js | 16 +++++++++- apps/presentationeditor/main/locale/en.json | 2 ++ .../main/app/controller/LeftMenu.js | 1 + .../main/app/controller/Main.js | 29 +++++++++++++++---- .../main/app/view/FileMenu.js | 16 +++++++++- apps/spreadsheeteditor/main/locale/en.json | 2 ++ 18 files changed, 190 insertions(+), 26 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index d61245c723..0cbb9f86a1 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -131,7 +131,11 @@ url: 'http://...', text: 'Go to London', blank: true, - requestClose: false // if true - goback send onRequestClose event instead opening url + requestClose: false // if true - goback send onRequestClose event instead opening url, deprecated, use customization.close instead + }, + close: { + visible: false, + text: 'Close file' }, reviewPermissions: { "Group1": ["Group2"], // users from Group1 can accept/reject review changes made by users from Group2 diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 243f1cc6e3..f5630f4547 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -127,6 +127,7 @@ define([ '
' + '' + '' + + '
' + '' + '' + ''; @@ -158,6 +159,7 @@ define([ '
' + '' + '' + + '
' + '' + ''; @@ -312,6 +314,13 @@ define([ Common.NotificationCenter.trigger('goback'); }); + if (me.btnClose) { + me.btnClose.on('click', function (e) { + Common.NotificationCenter.trigger('close'); + }); + me.btnClose.updateHint(appConfig.customization.close.text || me.textClose); + } + me.btnFavorite.on('click', function (e) { // wait for setFavorite method // me.options.favorite = !me.options.favorite; @@ -724,6 +733,9 @@ define([ } $btnUserName = $html.find('.color-user-name'); me.setUserName(me.options.userName); + + if ( config.canCloseEditor ) + me.btnClose = createTitleButton('toolbar__icon icon--inverse btn-close', $html.findById('#slot-btn-close'), false, 'bottom', 'big'); } if (!_readonlyRights && config && (config.sharingSettingsUrl && config.sharingSettingsUrl.length || config.canRequestSharingSettings)) { @@ -803,6 +815,9 @@ define([ $btnUserName = $html.find('.color-user-name'); me.setUserName(me.options.userName); + if ( config.canCloseEditor ) + me.btnClose = createTitleButton('toolbar__icon icon--inverse btn-close', $html.findById('#slot-btn-close'), false, 'left', '10, 10'); + if ( config.canPrint && (config.isEdit || isPDFEditor && config.isRestrictedEdit) ) { me.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-btn-dt-print'), true, undefined, undefined, 'P'); } @@ -1111,7 +1126,8 @@ define([ tipDocEdit: 'Editing', textReview: 'Reviewing', textReviewDesc: 'Suggest changes', - tipReview: 'Reviewing' + tipReview: 'Reviewing', + textClose: 'Close file' } }(), Common.Views.Header || {})) }); diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 05b6317edf..476706cfe8 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -305,6 +305,7 @@ define([ case 'external-help': close_menu = !!isopts; break; + case 'close-editor': Common.NotificationCenter.trigger('close'); break; default: close_menu = false; } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index b8373c6b23..796a2ee933 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -236,6 +236,7 @@ define([ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); + Common.NotificationCenter.on('close', _.bind(this.closeEditor, this)); Common.NotificationCenter.on('markfavorite', _.bind(this.markFavorite, this)); Common.NotificationCenter.on('download:advanced', _.bind(this.onAdvancedOptions, this)); Common.NotificationCenter.on('showmessage', _.bind(this.onExternalMessage, this)); @@ -443,10 +444,6 @@ define([ this.appOptions.mergeFolderUrl = this.editorConfig.mergeFolderUrl; this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; this.appOptions.canAnalytics = false; - this.appOptions.canRequestClose = this.editorConfig.canRequestClose; - this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object') - && (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose); - this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canPlugins = false; this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink; this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers; @@ -468,8 +465,26 @@ define([ this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); + this.appOptions.canRequestClose = this.editorConfig.canRequestClose; + this.appOptions.canCloseEditor = false; + + var _canback = false; + if (typeof this.appOptions.customization === 'object') { + if (typeof this.appOptions.customization.goback == 'object' && this.editorConfig.canBackToFolder!==false) { + _canback = this.appOptions.customization.close===undefined ? + !_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose : + !_.isEmpty(this.editorConfig.customization.goback.url) && !this.editorConfig.customization.goback.requestClose; + + if (this.appOptions.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof this.appOptions.customization.close === 'object') + this.appOptions.canCloseEditor = !!this.appOptions.customization.close.visible && this.appOptions.canRequestClose && !this.appOptions.isDesktopApp; + } + this.appOptions.canBack = this.appOptions.canBackToFolder = !!_canback; + appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header'); - appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : ''); + appHeader.setCanBack(this.appOptions.canBack, this.appOptions.canBack ? this.appOptions.customization.goback.text : ''); if (this.editorConfig.lang) this.api.asc_setLocale(this.editorConfig.lang); @@ -960,6 +975,10 @@ define([ } }, + closeEditor: function() { + this.appOptions.canRequestClose && this.onRequestClose(); + }, + markFavorite: function(favorite) { if ( !Common.Controllers.Desktop.process('markfavorite') ) { Common.Gateway.metaChange({ diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 23347bd1de..9d113fe30c 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -518,6 +518,19 @@ define([ dataHintDirection: 'left-top', dataHintOffset: [2, 14] })); + } else if (this.mode.canCloseEditor) { + $('
  • ' + + '
  • ').insertAfter($('#fm-btn-back', this.$el)); + this.items.push( + new Common.UI.MenuItem({ + el : $('#fm-btn-close', this.$el), + action : 'close-editor', + caption : this.mode.customization.close.text || this.btnCloseEditor, + canFocused: false, + dataHint: 1, + dataHintDirection: 'left-top', + dataHintOffset: [2, 14] + })); } }, @@ -655,6 +668,7 @@ define([ btnProtectCaption: 'Protect', btnSaveCopyAsCaption : 'Save Copy as...', btnExitCaption : 'Exit', - btnFileOpenCaption : 'Open...' + btnFileOpenCaption : 'Open...', + btnCloseEditor : 'Close File' }, DE.Views.FileMenu || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 90c3bb9ef3..8493b67219 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -552,6 +552,7 @@ "Common.Views.Header.textReview": "Reviewing", "Common.Views.Header.textReviewDesc": "Suggest changes", "Common.Views.Header.tipReview": "Reviewing", + "Common.Views.Header.textClose": "Close file", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", @@ -2050,6 +2051,7 @@ "DE.Views.FileMenu.btnSettingsCaption": "Advanced Settings", "DE.Views.FileMenu.btnToEditCaption": "Edit Document", "DE.Views.FileMenu.textDownload": "Download", + "DE.Views.FileMenu.btnCloseEditor": "Close File", "DE.Views.FileMenuPanels.CreateNew.txtBlank": "Blank document", "DE.Views.FileMenuPanels.CreateNew.txtCreateNew": "Create New", "DE.Views.FileMenuPanels.DocumentInfo.okButtonText": "Apply", diff --git a/apps/pdfeditor/main/app/controller/LeftMenu.js b/apps/pdfeditor/main/app/controller/LeftMenu.js index 9fc1d35fe4..3a00c9cd29 100644 --- a/apps/pdfeditor/main/app/controller/LeftMenu.js +++ b/apps/pdfeditor/main/app/controller/LeftMenu.js @@ -261,6 +261,7 @@ define([ case 'external-help': close_menu = !!isopts; break; + case 'close-editor': Common.NotificationCenter.trigger('close'); break; default: close_menu = false; } diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index 41ebd889b0..a263610c66 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -186,6 +186,7 @@ define([ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); + Common.NotificationCenter.on('close', _.bind(this.closeEditor, this)); Common.NotificationCenter.on('markfavorite', _.bind(this.markFavorite, this)); Common.NotificationCenter.on('download:advanced', _.bind(this.onAdvancedOptions, this)); Common.NotificationCenter.on('showmessage', _.bind(this.onExternalMessage, this)); @@ -389,10 +390,6 @@ define([ this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl; this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; this.appOptions.canAnalytics = false; - this.appOptions.canRequestClose = this.editorConfig.canRequestClose; - this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object') - && (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose); - this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canPlugins = false; this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink; this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers; @@ -407,8 +404,26 @@ define([ this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); + this.appOptions.canRequestClose = this.editorConfig.canRequestClose; + this.appOptions.canCloseEditor = false; + + var _canback = false; + if (typeof this.appOptions.customization === 'object') { + if (typeof this.appOptions.customization.goback == 'object' && this.editorConfig.canBackToFolder!==false) { + _canback = this.appOptions.customization.close===undefined ? + !_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose : + !_.isEmpty(this.editorConfig.customization.goback.url) && !this.editorConfig.customization.goback.requestClose; + + if (this.appOptions.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof this.appOptions.customization.close === 'object') + this.appOptions.canCloseEditor = !!this.appOptions.customization.close.visible && this.appOptions.canRequestClose && !this.appOptions.isDesktopApp; + } + this.appOptions.canBack = this.appOptions.canBackToFolder = !!_canback; + appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header'); - appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : ''); + appHeader.setCanBack(this.appOptions.canBack, this.appOptions.canBack ? this.editorConfig.customization.goback.text : ''); if (this.editorConfig.lang) this.api.asc_setLocale(this.editorConfig.lang); @@ -694,6 +709,10 @@ define([ } }, + closeEditor: function() { + this.appOptions.canRequestClose && this.onRequestClose(); + }, + markFavorite: function(favorite) { if ( !Common.Controllers.Desktop.process('markfavorite') ) { Common.Gateway.metaChange({ diff --git a/apps/pdfeditor/main/app/view/FileMenu.js b/apps/pdfeditor/main/app/view/FileMenu.js index 440d913337..80f18492cb 100644 --- a/apps/pdfeditor/main/app/view/FileMenu.js +++ b/apps/pdfeditor/main/app/view/FileMenu.js @@ -497,6 +497,19 @@ define([ dataHintDirection: 'left-top', dataHintOffset: [2, 14] })); + } else if (this.mode.canCloseEditor) { + $('
  • ' + + '
  • ').insertAfter($('#fm-btn-back', this.$el)); + this.items.push( + new Common.UI.MenuItem({ + el : $('#fm-btn-close', this.$el), + action : 'close-editor', + caption : this.mode.customization.close.text || this.btnCloseEditor, + canFocused: false, + dataHint: 1, + dataHintDirection: 'left-top', + dataHintOffset: [2, 14] + })); } }, @@ -625,6 +638,7 @@ define([ btnProtectCaption: 'Protect', btnSaveCopyAsCaption : 'Save Copy as...', btnExitCaption : 'Exit', - btnFileOpenCaption : 'Open...' + btnFileOpenCaption : 'Open...', + btnCloseEditor : 'Close File' }, PDFE.Views.FileMenu || {})); }); diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index 82f45e9269..8ba2f20c83 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -223,6 +223,7 @@ "Common.Views.Header.tipView": "Viewing", "Common.Views.Header.tipComment": "Commenting", "Common.Views.Header.tipEdit": "Editing", + "Common.Views.Header.textClose": "Close file", "Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:", "Common.Views.ImageFromUrlDialog.txtEmpty": "This field is required", "Common.Views.ImageFromUrlDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format", @@ -516,6 +517,7 @@ "PDFE.Views.FileMenu.btnSettingsCaption": "Advanced Settings", "PDFE.Views.FileMenu.btnToEditCaption": "Edit Document", "PDFE.Views.FileMenu.textDownload": "Download", + "PDFE.Views.FileMenu.btnCloseEditor": "Close File", "PDFE.Views.FileMenuPanels.CreateNew.txtBlank": "Blank Document", "PDFE.Views.FileMenuPanels.CreateNew.txtCreateNew": "Create new", "PDFE.Views.FileMenuPanels.DocumentInfo.okButtonText": "Apply", diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index c6caddf85a..fa18c5c89a 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -277,6 +277,7 @@ define([ } break; case 'external-help': close_menu = true; break; + case 'close-editor': Common.NotificationCenter.trigger('close'); break; default: close_menu = false; } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index b702611255..698a75281d 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -211,6 +211,7 @@ define([ this.api.asc_registerCallback('asc_onSpellCheckInit', _.bind(this.loadLanguages, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); + Common.NotificationCenter.on('close', _.bind(this.closeEditor, this)); Common.NotificationCenter.on('showmessage', _.bind(this.onExternalMessage, this)); Common.NotificationCenter.on('showerror', _.bind(this.onError, this)); Common.NotificationCenter.on('markfavorite', _.bind(this.markFavorite, this)); @@ -399,10 +400,6 @@ define([ this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl; this.appOptions.canAnalytics = false; - this.appOptions.canRequestClose = this.editorConfig.canRequestClose; - this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object') - && (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose); - this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canPlugins = false; this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers; this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify; @@ -415,8 +412,26 @@ define([ this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); + this.appOptions.canRequestClose = this.editorConfig.canRequestClose; + this.appOptions.canCloseEditor = false; + + var _canback = false; + if (typeof this.appOptions.customization === 'object') { + if (typeof this.appOptions.customization.goback == 'object' && this.editorConfig.canBackToFolder!==false) { + _canback = this.appOptions.customization.close===undefined ? + !_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose : + !_.isEmpty(this.editorConfig.customization.goback.url) && !this.editorConfig.customization.goback.requestClose; + + if (this.appOptions.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof this.appOptions.customization.close === 'object') + this.appOptions.canCloseEditor = !!this.appOptions.customization.close.visible && this.appOptions.canRequestClose && !this.appOptions.isDesktopApp; + } + this.appOptions.canBack = this.appOptions.canBackToFolder = !!_canback; + appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header'); - appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : ''); + appHeader.setCanBack(this.appOptions.canBack, this.appOptions.canBack ? this.appOptions.customization.goback.text : ''); if (this.editorConfig.lang) this.api.asc_setLocale(this.editorConfig.lang); @@ -614,6 +629,10 @@ define([ } }, + closeEditor: function() { + this.appOptions.canRequestClose && this.onRequestClose(); + }, + markFavorite: function(favorite) { if ( !Common.Controllers.Desktop.process('markfavorite') ) { Common.Gateway.metaChange({ diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index caf7fc58bf..17933e897b 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -513,6 +513,19 @@ define([ dataHintDirection: 'left-top', dataHintOffset: [2, 14] })); + } else if (this.mode.canCloseEditor) { + $('
  • ' + + '
  • ').insertAfter($('#fm-btn-back', this.$el)); + this.items.push( + new Common.UI.MenuItem({ + el : $('#fm-btn-close', this.$el), + action : 'close-editor', + caption : this.mode.customization.close.text || this.btnCloseEditor, + canFocused: false, + dataHint: 1, + dataHintDirection: 'left-top', + dataHintOffset: [2, 14] + })); } }, @@ -662,6 +675,7 @@ define([ btnSaveCopyAsCaption : 'Save Copy as...', btnHistoryCaption : 'Versions History', btnExitCaption : 'Exit', - btnFileOpenCaption : 'Open...' + btnFileOpenCaption : 'Open...', + btnCloseEditor : 'Close File' }, PE.Views.FileMenu || {})); }); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 9426e7aae0..6c5c8f06f6 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -636,6 +636,7 @@ "Common.Views.Header.tipViewUsers": "View users and manage document access rights", "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", + "Common.Views.Header.textClose": "Close file", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", @@ -1926,6 +1927,7 @@ "PE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy As", "PE.Views.FileMenu.btnSettingsCaption": "Advanced Settings", "PE.Views.FileMenu.btnToEditCaption": "Edit Presentation", + "PE.Views.FileMenu.btnCloseEditor": "Close File", "PE.Views.FileMenuPanels.CreateNew.txtBlank": "Blank Presentation", "PE.Views.FileMenuPanels.CreateNew.txtCreateNew": "Create New", "PE.Views.FileMenuPanels.DocumentInfo.okButtonText": "Apply", diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 40da6e7c96..9777c09017 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -318,6 +318,7 @@ define([ } break; case 'external-help': close_menu = true; break; + case 'close-editor': Common.NotificationCenter.trigger('close'); break; default: close_menu = false; } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 674e61ddee..e597ec4d03 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -234,6 +234,7 @@ define([ this.api.asc_registerCallback('asc_onOleEditorReady', _.bind(this.onOleEditorReady, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); + Common.NotificationCenter.on('close', _.bind(this.closeEditor, this)); Common.NotificationCenter.on('namedrange:locked', _.bind(this.onNamedRangeLocked, this)); Common.NotificationCenter.on('protectedrange:locked', _.bind(this.onProtectedRangeLocked, this)); Common.NotificationCenter.on('download:cancel', _.bind(this.onDownloadCancel, this)); @@ -450,10 +451,6 @@ define([ this.appOptions.isEditDiagram = this.editorConfig.mode == 'editdiagram'; this.appOptions.isEditMailMerge = this.editorConfig.mode == 'editmerge'; this.appOptions.isEditOle = this.editorConfig.mode == 'editole'; - this.appOptions.canRequestClose = this.editorConfig.canRequestClose; - this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object') - && (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose); - this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canPlugins = false; this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers; this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify; @@ -473,8 +470,26 @@ define([ if (this.appOptions.user.guest && this.appOptions.canRenameAnonymous && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); + this.appOptions.canRequestClose = this.editorConfig.canRequestClose; + this.appOptions.canCloseEditor = false; + + var _canback = false; + if (typeof this.appOptions.customization === 'object') { + if (typeof this.appOptions.customization.goback == 'object' && this.editorConfig.canBackToFolder!==false) { + _canback = this.appOptions.customization.close===undefined ? + !_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose : + !_.isEmpty(this.editorConfig.customization.goback.url) && !this.editorConfig.customization.goback.requestClose; + + if (this.appOptions.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof this.appOptions.customization.close === 'object') + this.appOptions.canCloseEditor = !!this.appOptions.customization.close.visible && this.appOptions.canRequestClose && !this.appOptions.isDesktopApp; + } + this.appOptions.canBack = this.appOptions.canBackToFolder = !!_canback; + this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header'); - this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : ''); + this.headerView.setCanBack(this.appOptions.canBack, this.appOptions.canBack ? this.editorConfig.customization.goback.text : ''); var reg = Common.localStorage.getItem("sse-settings-reg-settings"), isUseBaseSeparator = Common.localStorage.getBool("sse-settings-use-base-separator", true), @@ -700,6 +715,10 @@ define([ } }, + closeEditor: function() { + this.appOptions.canRequestClose && this.onRequestClose(); + }, + markFavorite: function(favorite) { if ( !Common.Controllers.Desktop.process('markfavorite') ) { Common.Gateway.metaChange({ diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 594b1086f5..4a69c3c73b 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -501,6 +501,19 @@ define([ dataHintDirection: 'left-top', dataHintOffset: [2, 14] })); + } else if (this.mode.canCloseEditor) { + $('
  • ' + + '
  • ').insertAfter($('#fm-btn-back', this.$el)); + this.items.push( + new Common.UI.MenuItem({ + el : $('#fm-btn-close', this.$el), + action : 'close-editor', + caption : this.mode.customization.close.text || this.btnCloseEditor, + canFocused: false, + dataHint: 1, + dataHintDirection: 'left-top', + dataHintOffset: [2, 14] + })); } }, @@ -638,6 +651,7 @@ define([ btnHistoryCaption : 'Versions History', btnExitCaption : 'Exit', btnFileOpenCaption : 'Open...', - btnExportToPDFCaption : 'Export to PDF' + btnExportToPDFCaption : 'Export to PDF', + btnCloseEditor : 'Close File' }, SSE.Views.FileMenu || {})); }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index a02198d5e0..139e4f9518 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -473,6 +473,7 @@ "Common.Views.Header.tipViewUsers": "View users and manage document access rights", "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", + "Common.Views.Header.textClose": "Close file", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", @@ -2552,6 +2553,7 @@ "SSE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy As", "SSE.Views.FileMenu.btnSettingsCaption": "Advanced Settings", "SSE.Views.FileMenu.btnToEditCaption": "Edit Spreadsheet", + "SSE.Views.FileMenu.btnCloseEditor": "Close File", "SSE.Views.FileMenuPanels.CreateNew.txtBlank": "Blank Spreadsheet", "SSE.Views.FileMenuPanels.CreateNew.txtCreateNew": "Create New", "SSE.Views.FileMenuPanels.DocumentInfo.okButtonText": "Apply", From a2e336b8ddea081cad827b20ba2ea5179b885d98 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 9 Feb 2024 17:47:30 +0300 Subject: [PATCH 2/5] [Embedded] Add Close button to editor toolbar. --- apps/documenteditor/embed/index.html | 1 + apps/documenteditor/embed/index.html.deploy | 1 + apps/documenteditor/embed/index_loader.html | 1 + .../embed/index_loader.html.deploy | 1 + .../embed/js/ApplicationController.js | 25 ++++++++++++++++-- apps/presentationeditor/embed/index.html | 1 + .../embed/index.html.deploy | 1 + .../embed/index_loader.html | 1 + .../embed/index_loader.html.deploy | 1 + .../embed/js/ApplicationController.js | 25 ++++++++++++++++-- apps/spreadsheeteditor/embed/index.html | 1 + .../spreadsheeteditor/embed/index.html.deploy | 1 + .../spreadsheeteditor/embed/index_loader.html | 1 + .../embed/index_loader.html.deploy | 1 + .../embed/js/ApplicationController.js | 26 +++++++++++++++++-- 15 files changed, 82 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/embed/index.html b/apps/documenteditor/embed/index.html index 9242b17b78..0d5a9e1833 100644 --- a/apps/documenteditor/embed/index.html +++ b/apps/documenteditor/embed/index.html @@ -238,6 +238,7 @@ + diff --git a/apps/documenteditor/embed/index.html.deploy b/apps/documenteditor/embed/index.html.deploy index 5fd9b41c37..1f9624b66c 100644 --- a/apps/documenteditor/embed/index.html.deploy +++ b/apps/documenteditor/embed/index.html.deploy @@ -229,6 +229,7 @@ + diff --git a/apps/documenteditor/embed/index_loader.html b/apps/documenteditor/embed/index_loader.html index b972da3666..561f102f5c 100644 --- a/apps/documenteditor/embed/index_loader.html +++ b/apps/documenteditor/embed/index_loader.html @@ -304,6 +304,7 @@ + diff --git a/apps/documenteditor/embed/index_loader.html.deploy b/apps/documenteditor/embed/index_loader.html.deploy index 7844bb22e3..80faf7d237 100644 --- a/apps/documenteditor/embed/index_loader.html.deploy +++ b/apps/documenteditor/embed/index_loader.html.deploy @@ -296,6 +296,7 @@ + diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 1210474c36..2e03283b57 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -89,8 +89,21 @@ DE.ApplicationController = new(function(){ ttOffset[1] = 40; } - config.canBackToFolder = (config.canBackToFolder!==false) && config.customization && config.customization.goback && - (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose); + config.canCloseEditor = false; + var _canback = false; + if (typeof config.customization === 'object') { + if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { + _canback = config.customization.close===undefined ? + config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose : + config.customization.goback.url && !config.customization.goback.requestClose; + + if (config.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof config.customization.close === 'object') + config.canCloseEditor = !!config.customization.close.visible && config.canRequestClose && !config.isDesktopApp; + } + config.canBackToFolder = !!_canback; } function loadDocument(data) { @@ -428,6 +441,10 @@ DE.ApplicationController = new(function(){ text && (typeof text == 'string') && $('#idt-close .caption').text(text); } + if (config.canCloseEditor) { + $('#id-btn-close-editor').removeClass('hidden'); + } + if (itemsCount < 7) { $(dividers[0]).hide(); $(dividers[1]).hide(); @@ -508,6 +525,10 @@ DE.ApplicationController = new(function(){ } }); + $('#id-btn-close-editor').on('click', function(){ + config.canRequestClose && Common.Gateway.requestClose(); + }); + var downloadAs = function(format){ api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); Common.Analytics.trackEvent('Save'); diff --git a/apps/presentationeditor/embed/index.html b/apps/presentationeditor/embed/index.html index 7612845e14..bc39a941d8 100644 --- a/apps/presentationeditor/embed/index.html +++ b/apps/presentationeditor/embed/index.html @@ -258,6 +258,7 @@ + diff --git a/apps/presentationeditor/embed/index.html.deploy b/apps/presentationeditor/embed/index.html.deploy index 750b12db7a..db1d100ce4 100644 --- a/apps/presentationeditor/embed/index.html.deploy +++ b/apps/presentationeditor/embed/index.html.deploy @@ -252,6 +252,7 @@ + diff --git a/apps/presentationeditor/embed/index_loader.html b/apps/presentationeditor/embed/index_loader.html index 513204c119..96c171ea99 100644 --- a/apps/presentationeditor/embed/index_loader.html +++ b/apps/presentationeditor/embed/index_loader.html @@ -302,6 +302,7 @@ + diff --git a/apps/presentationeditor/embed/index_loader.html.deploy b/apps/presentationeditor/embed/index_loader.html.deploy index f1bfc2be1d..2a4f1dbc52 100644 --- a/apps/presentationeditor/embed/index_loader.html.deploy +++ b/apps/presentationeditor/embed/index_loader.html.deploy @@ -295,6 +295,7 @@ + diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js index dacaa3568a..b99f8bac0b 100644 --- a/apps/presentationeditor/embed/js/ApplicationController.js +++ b/apps/presentationeditor/embed/js/ApplicationController.js @@ -86,8 +86,21 @@ PE.ApplicationController = new(function(){ $('#box-preview').addClass('top'); } - config.canBackToFolder = (config.canBackToFolder!==false) && config.customization && config.customization.goback && - (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose); + config.canCloseEditor = false; + var _canback = false; + if (typeof config.customization === 'object') { + if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { + _canback = config.customization.close===undefined ? + config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose : + config.customization.goback.url && !config.customization.goback.requestClose; + + if (config.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof config.customization.close === 'object') + config.canCloseEditor = !!config.customization.close.visible && config.canRequestClose && !config.isDesktopApp; + } + config.canBackToFolder = !!_canback; } function loadDocument(data) { @@ -294,6 +307,10 @@ PE.ApplicationController = new(function(){ text && (typeof text == 'string') && $('#idt-close .caption').text(text); } + if (config.canCloseEditor) { + $('#id-btn-close-editor').removeClass('hidden'); + } + if (itemsCount < 7) { $(dividers[0]).hide(); $(dividers[1]).hide(); @@ -372,6 +389,10 @@ PE.ApplicationController = new(function(){ } }); + $('#id-btn-close-editor').on('click', function(){ + config.canRequestClose && Common.Gateway.requestClose(); + }); + PE.ApplicationView.tools.get('#idt-search') .on('click', function(){ common.controller.SearchBar.show(); diff --git a/apps/spreadsheeteditor/embed/index.html b/apps/spreadsheeteditor/embed/index.html index 0f4c285716..cc561d86e4 100644 --- a/apps/spreadsheeteditor/embed/index.html +++ b/apps/spreadsheeteditor/embed/index.html @@ -232,6 +232,7 @@ + diff --git a/apps/spreadsheeteditor/embed/index.html.deploy b/apps/spreadsheeteditor/embed/index.html.deploy index 765218b17c..3b2c511069 100644 --- a/apps/spreadsheeteditor/embed/index.html.deploy +++ b/apps/spreadsheeteditor/embed/index.html.deploy @@ -223,6 +223,7 @@ + diff --git a/apps/spreadsheeteditor/embed/index_loader.html b/apps/spreadsheeteditor/embed/index_loader.html index 1c7dab986a..bad38ace6d 100644 --- a/apps/spreadsheeteditor/embed/index_loader.html +++ b/apps/spreadsheeteditor/embed/index_loader.html @@ -301,6 +301,7 @@ + diff --git a/apps/spreadsheeteditor/embed/index_loader.html.deploy b/apps/spreadsheeteditor/embed/index_loader.html.deploy index 39dbc34571..50e66e1569 100644 --- a/apps/spreadsheeteditor/embed/index_loader.html.deploy +++ b/apps/spreadsheeteditor/embed/index_loader.html.deploy @@ -293,6 +293,7 @@ + diff --git a/apps/spreadsheeteditor/embed/js/ApplicationController.js b/apps/spreadsheeteditor/embed/js/ApplicationController.js index 8a4e91b537..fd36201ffa 100644 --- a/apps/spreadsheeteditor/embed/js/ApplicationController.js +++ b/apps/spreadsheeteditor/embed/js/ApplicationController.js @@ -86,8 +86,22 @@ SSE.ApplicationController = new(function(){ $('.viewer').addClass('top'); } - config.canBackToFolder = (config.canBackToFolder!==false) && config.customization && config.customization.goback && - (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose); + config.canCloseEditor = false; + var _canback = false; + if (typeof config.customization === 'object') { + if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { + _canback = config.customization.close===undefined ? + config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose : + config.customization.goback.url && !config.customization.goback.requestClose; + + if (config.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof config.customization.close === 'object') + config.canCloseEditor = !!config.customization.close.visible && config.canRequestClose && !config.isDesktopApp; + } + config.canBackToFolder = !!_canback; + var reg = (typeof (config.region) == 'string') ? config.region.toLowerCase() : config.region; reg = Common.util.LanguageInfo.getLanguages().hasOwnProperty(reg) ? reg : Common.util.LanguageInfo.getLocalLanguageCode(reg); if (reg!==null) @@ -239,6 +253,10 @@ SSE.ApplicationController = new(function(){ text && (typeof text == 'string') && $('#idt-close .caption').text(text); } + if (config.canCloseEditor) { + $('#id-btn-close-editor').removeClass('hidden'); + } + if (itemsCount < 7) { $(dividers[0]).hide(); $(dividers[1]).hide(); @@ -310,6 +328,10 @@ SSE.ApplicationController = new(function(){ } }); + $('#id-btn-close-editor').on('click', function(){ + config.canRequestClose && Common.Gateway.requestClose(); + }); + SSE.ApplicationView.tools.get('#idt-search') .on('click', function(){ common.controller.SearchBar.show(); From ee897952c08cefcf740721adbcc6d35f96dca10d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 12 Feb 2024 11:49:03 +0300 Subject: [PATCH 3/5] [Mobile] Handle "close" parameter in customization section --- .../mobile/src/controller/Toolbar.jsx | 15 +++++++++++---- .../mobile/src/store/appOptions.js | 18 +++++++++++++++--- .../mobile/src/controller/Toolbar.jsx | 15 +++++++++++---- .../mobile/src/store/appOptions.js | 18 +++++++++++++++--- .../mobile/src/controller/Toolbar.jsx | 15 +++++++++++---- .../mobile/src/store/appOptions.js | 18 +++++++++++++++--- 6 files changed, 78 insertions(+), 21 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index 4d29c4d74c..80ea9800d8 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -51,6 +51,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.on('goback', goBack); + Common.Notifications.on('close', onClose); if (isDisconnected) { f7.popover.close(); @@ -62,6 +63,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); + Common.Notifications.off('close', onClose); } }, []); @@ -118,10 +120,11 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && - data.config.customization && data.config.customization.goback && - (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) - { - setShowBack(true); + data.config.customization && data.config.customization.goback) { + var _canback = data.config.customization.close===undefined ? + data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose : + data.config.customization.goback.url && !data.config.customization.goback.requestClose; + _canback && setShowBack(true); } }; @@ -172,6 +175,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto } } + const onClose = () => { + onRequestClose(); + } + const onUndo = () => { const api = Common.EditorApi.get(); if (api) { diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index 485e70e729..e059e8f274 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -128,9 +128,21 @@ export class storeAppOptions { this.saveAsUrl = config.saveAsUrl; this.canAnalytics = false; this.canRequestClose = config.canRequestClose; - this.canBackToFolder = (config.canBackToFolder!==false) && (typeof (config.customization) == 'object') && (typeof (config.customization.goback) == 'object') - && (!!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose); - this.canBack = this.canBackToFolder === true; + this.canCloseEditor = false; + var _canback = false; + if (typeof config.customization === 'object') { + if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { + _canback = config.customization.close===undefined ? + !!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose : + !!(config.customization.goback.url) && !config.customization.goback.requestClose; + + if (config.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof config.customization.close === 'object') + this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp; + } + this.canBack = this.canBackToFolder = !!_canback; this.canRequestSaveAs = config.canRequestSaveAs; this.canPlugins = false; this.canFeatureForms = !!Common.EditorApi.get().asc_isSupportFeature("forms"); diff --git a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx index 99ddf0760a..50f252545d 100644 --- a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx +++ b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx @@ -35,6 +35,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.on('goback', goBack); + Common.Notifications.on('close', onClose); if (isDisconnected) { f7.popover.close(); @@ -46,6 +47,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); + Common.Notifications.off('close', onClose); } }); @@ -53,10 +55,11 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && - data.config.customization && data.config.customization.goback && - (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) - { - setShowBack(true); + data.config.customization && data.config.customization.goback) { + var _canback = data.config.customization.close===undefined ? + data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose : + data.config.customization.goback.url && !data.config.customization.goback.requestClose; + _canback && setShowBack(true); } }; @@ -107,6 +110,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' } } + const onClose = () => { + onRequestClose(); + } + const onUndo = () => { const api = Common.EditorApi.get(); if (api) { diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js index e7401a8a7b..331d06f565 100644 --- a/apps/presentationeditor/mobile/src/store/appOptions.js +++ b/apps/presentationeditor/mobile/src/store/appOptions.js @@ -62,9 +62,21 @@ export class storeAppOptions { this.mergeFolderUrl = config.mergeFolderUrl; this.canAnalytics = false; this.canRequestClose = config.canRequestClose; - this.canBackToFolder = (config.canBackToFolder!==false) && (typeof (config.customization) == 'object') && (typeof (config.customization.goback) == 'object') - && (!!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose); - this.canBack = this.canBackToFolder === true; + this.canCloseEditor = false; + var _canback = false; + if (typeof config.customization === 'object') { + if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { + _canback = config.customization.close===undefined ? + !!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose : + !!(config.customization.goback.url) && !config.customization.goback.requestClose; + + if (config.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof config.customization.close === 'object') + this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp; + } + this.canBack = this.canBackToFolder = !!_canback; this.canPlugins = false; AscCommon.UserInfoParser.setParser(true); diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index cf36b9a986..661ea00ef3 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -43,6 +43,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.on('goback', goBack); + Common.Notifications.on('close', onClose); Common.Notifications.on('sheet:active', onApiActiveSheetChanged); if (isDisconnected) { @@ -55,6 +56,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); + Common.Notifications.off('close', onClose); Common.Notifications.off('sheet:active', onApiActiveSheetChanged); } }); @@ -63,10 +65,11 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && - data.config.customization && data.config.customization.goback && - (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) - { - setShowBack(true); + data.config.customization && data.config.customization.goback) { + var _canback = data.config.customization.close===undefined ? + data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose : + data.config.customization.goback.url && !data.config.customization.goback.requestClose; + _canback && setShowBack(true); } }; @@ -117,6 +120,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn } } + const onClose = () => { + onRequestClose(); + } + const onUndo = () => { const api = Common.EditorApi.get(); if (api) { diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index 4b26bde116..1f8030ae17 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -71,9 +71,21 @@ export class storeAppOptions { this.mergeFolderUrl = config.mergeFolderUrl; this.canAnalytics = false; this.canRequestClose = config.canRequestClose; - this.canBackToFolder = (config.canBackToFolder!==false) && (typeof (config.customization) == 'object') && (typeof (config.customization.goback) == 'object') - && (!!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose); - this.canBack = this.canBackToFolder === true; + this.canCloseEditor = false; + var _canback = false; + if (typeof config.customization === 'object') { + if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { + _canback = config.customization.close===undefined ? + !!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose : + !!(config.customization.goback.url) && !config.customization.goback.requestClose; + + if (config.customization.goback.requestClose) + console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + if (typeof config.customization.close === 'object') + this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp; + } + this.canBack = this.canBackToFolder = !!_canback; this.canPlugins = false; AscCommon.UserInfoParser.setParser(true); From 8fa7baafebf4e0a9e1ff736b1974d4a934bbff21 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Thu, 22 Feb 2024 11:05:56 +0100 Subject: [PATCH 4/5] [DE PE SSE mobile] Added editor close button --- apps/common/mobile/resources/less/common.less | 11 +++++++ apps/documenteditor/mobile/locale/en.json | 3 +- .../mobile/src/controller/Toolbar.jsx | 15 +++------ .../mobile/src/store/appOptions.js | 31 ++++++++++++------- .../mobile/src/view/settings/SettingsPage.jsx | 5 +++ apps/presentationeditor/mobile/locale/en.json | 3 +- .../mobile/src/controller/Toolbar.jsx | 12 +++---- .../mobile/src/store/appOptions.js | 31 ++++++++++++------- .../mobile/src/view/settings/SettingsPage.jsx | 7 ++++- apps/spreadsheeteditor/mobile/locale/en.json | 3 +- .../mobile/src/controller/Toolbar.jsx | 4 +-- .../mobile/src/store/appOptions.js | 31 ++++++++++++------- .../mobile/src/view/settings/SettingsPage.jsx | 5 +++ 13 files changed, 104 insertions(+), 57 deletions(-) diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less index 2af77d5005..c0726b87a3 100644 --- a/apps/common/mobile/resources/less/common.less +++ b/apps/common/mobile/resources/less/common.less @@ -1199,6 +1199,17 @@ input[type="number"]::-webkit-inner-spin-button { border-radius: 4px; } +// Close editor button +.close-editor-btn { + .item-inner { + padding-left: 36px; + } + + .item-title { + color: @text-error; + } +} + diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 9dc85dcd77..9d4a624ab6 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -785,7 +785,8 @@ "txtScheme6": "Concourse", "txtScheme7": "Equity", "txtScheme8": "Flow", - "txtScheme9": "Foundry" + "txtScheme9": "Foundry", + "textClose": "Close" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index 80ea9800d8..b9cdb6c589 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -51,7 +51,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.on('goback', goBack); - Common.Notifications.on('close', onClose); + Common.Notifications.on('close', onRequestClose); if (isDisconnected) { f7.popover.close(); @@ -63,7 +63,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); - Common.Notifications.off('close', onClose); + Common.Notifications.off('close', onRequestClose); } }, []); @@ -119,12 +119,11 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto // Back button const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { - if (data && data.config && data.config.canBackToFolder !== false && - data.config.customization && data.config.customization.goback) { - var _canback = data.config.customization.close===undefined ? + if (data && data.config && data.config?.canBackToFolder !== false && data.config?.customization && data.config?.customization.goback) { + const canback = data.config.customization.close === undefined ? data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose : data.config.customization.goback.url && !data.config.customization.goback.requestClose; - _canback && setShowBack(true); + canback && setShowBack(true); } }; @@ -175,10 +174,6 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto } } - const onClose = () => { - onRequestClose(); - } - const onUndo = () => { const api = Common.EditorApi.get(); if (api) { diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index e059e8f274..0dd34acd73 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -129,20 +129,29 @@ export class storeAppOptions { this.canAnalytics = false; this.canRequestClose = config.canRequestClose; this.canCloseEditor = false; - var _canback = false; - if (typeof config.customization === 'object') { - if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { - _canback = config.customization.close===undefined ? - !!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose : - !!(config.customization.goback.url) && !config.customization.goback.requestClose; - - if (config.customization.goback.requestClose) + + let canback = false; + + if (typeof config.customization === 'object' && config.customization !== null) { + const { goback, close } = config.customization; + + if (typeof goback === 'object' && config.canBackToFolder !== false) { + const hasUrl = !!goback.url; + const requestClose = goback.requestClose && this.canRequestClose; + + canBack = close === undefined ? hasUrl || requestClose : hasUrl && !goback.requestClose; + + if (goback.requestClose) { console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + } + + if (typeof close === 'object' && close !== null) { + this.canCloseEditor = !!close.visible && this.canRequestClose && !this.isDesktopApp; } - if (typeof config.customization.close === 'object') - this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp; } - this.canBack = this.canBackToFolder = !!_canback; + + this.canBack = this.canBackToFolder = canback; this.canRequestSaveAs = config.canRequestSaveAs; this.canPlugins = false; this.canFeatureForms = !!Common.EditorApi.get().asc_isSupportFeature("forms"); diff --git a/apps/documenteditor/mobile/src/view/settings/SettingsPage.jsx b/apps/documenteditor/mobile/src/view/settings/SettingsPage.jsx index 3b73ffdd10..1db5ad3400 100644 --- a/apps/documenteditor/mobile/src/view/settings/SettingsPage.jsx +++ b/apps/documenteditor/mobile/src/view/settings/SettingsPage.jsx @@ -38,6 +38,8 @@ const SettingsPage = inject("storeAppOptions", "storeReview", "storeDocumentInfo const canFillForms = appOptions.canFillForms; const isEditableForms = isForm && canFillForms; const canSubmitForms = appOptions.canSubmitForms; + const canCloseEditor = appOptions.canCloseEditor; + const closeButtonText = canCloseEditor && appOptions.customization.close.text; let _isEdit = false, _canDownload = false, @@ -185,6 +187,9 @@ const SettingsPage = inject("storeAppOptions", "storeReview", "storeDocumentInfo } + {canCloseEditor && + Common.Notifications.trigger('close')}> + } ) diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 5f6a669a37..fe45a24318 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -549,7 +549,8 @@ "txtScheme6": "Concourse", "txtScheme7": "Equity", "txtScheme8": "Flow", - "txtScheme9": "Foundry" + "txtScheme9": "Foundry", + "textClose": "Close" } } } \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx index 50f252545d..1d4f83f86c 100644 --- a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx +++ b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx @@ -35,7 +35,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.on('goback', goBack); - Common.Notifications.on('close', onClose); + Common.Notifications.on('close', onRequestClose); if (isDisconnected) { f7.popover.close(); @@ -47,7 +47,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); - Common.Notifications.off('close', onClose); + Common.Notifications.off('close', onRequestClose); } }); @@ -56,10 +56,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && data.config.customization && data.config.customization.goback) { - var _canback = data.config.customization.close===undefined ? + const canback = data.config.customization.close === undefined ? data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose : data.config.customization.goback.url && !data.config.customization.goback.requestClose; - _canback && setShowBack(true); + canback && setShowBack(true); } }; @@ -110,10 +110,6 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' } } - const onClose = () => { - onRequestClose(); - } - const onUndo = () => { const api = Common.EditorApi.get(); if (api) { diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js index 331d06f565..f26133a688 100644 --- a/apps/presentationeditor/mobile/src/store/appOptions.js +++ b/apps/presentationeditor/mobile/src/store/appOptions.js @@ -63,20 +63,29 @@ export class storeAppOptions { this.canAnalytics = false; this.canRequestClose = config.canRequestClose; this.canCloseEditor = false; - var _canback = false; - if (typeof config.customization === 'object') { - if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { - _canback = config.customization.close===undefined ? - !!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose : - !!(config.customization.goback.url) && !config.customization.goback.requestClose; - - if (config.customization.goback.requestClose) + + let canback = false; + + if (typeof config.customization === 'object' && config.customization !== null) { + const { goback, close } = config.customization; + + if (typeof goback === 'object' && config.canBackToFolder !== false) { + const hasUrl = !!goback.url; + const requestClose = goback.requestClose && this.canRequestClose; + + canBack = close === undefined ? hasUrl || requestClose : hasUrl && !goback.requestClose; + + if (goback.requestClose) { console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + } + + if (typeof close === 'object' && close !== null) { + this.canCloseEditor = !!close.visible && this.canRequestClose && !this.isDesktopApp; } - if (typeof config.customization.close === 'object') - this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp; } - this.canBack = this.canBackToFolder = !!_canback; + + this.canBack = this.canBackToFolder = canback; this.canPlugins = false; AscCommon.UserInfoParser.setParser(true); diff --git a/apps/presentationeditor/mobile/src/view/settings/SettingsPage.jsx b/apps/presentationeditor/mobile/src/view/settings/SettingsPage.jsx index 39ed7c27db..5c8cca6ff2 100644 --- a/apps/presentationeditor/mobile/src/view/settings/SettingsPage.jsx +++ b/apps/presentationeditor/mobile/src/view/settings/SettingsPage.jsx @@ -16,6 +16,8 @@ const SettingsPage = inject('storeAppOptions', 'storeToolbarSettings', 'storePre const disabledPreview = storeToolbarSettings.countPages <= 0; const storePresentationInfo = props.storePresentationInfo; const docTitle = storePresentationInfo.dataDoc ? storePresentationInfo.dataDoc.title : ''; + const canCloseEditor = appOptions.canCloseEditor; + const closeButtonText = canCloseEditor && appOptions.customization.close.text; const navbar =
    {docTitle}
    @@ -120,9 +122,12 @@ const SettingsPage = inject('storeAppOptions', 'storeToolbarSettings', 'storePre } {_canFeedback && - + } + {canCloseEditor && + Common.Notifications.trigger('close')}> + } ) diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 441ec98efb..0787c5666c 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -827,7 +827,8 @@ "txtUk": "Ukrainian", "txtVi": "Vietnamese", "txtZh": "Chinese", - "warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
    Are you sure you want to continue?" + "warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
    Are you sure you want to continue?", + "textClose": "Close" } } } \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index 661ea00ef3..b188fb9466 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -66,10 +66,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && data.config.customization && data.config.customization.goback) { - var _canback = data.config.customization.close===undefined ? + const canback = data.config.customization.close === undefined ? data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose : data.config.customization.goback.url && !data.config.customization.goback.requestClose; - _canback && setShowBack(true); + canback && setShowBack(true); } }; diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index 1f8030ae17..22d5b3034e 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -72,20 +72,29 @@ export class storeAppOptions { this.canAnalytics = false; this.canRequestClose = config.canRequestClose; this.canCloseEditor = false; - var _canback = false; - if (typeof config.customization === 'object') { - if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) { - _canback = config.customization.close===undefined ? - !!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose : - !!(config.customization.goback.url) && !config.customization.goback.requestClose; - - if (config.customization.goback.requestClose) + + let canback = false; + + if (typeof config.customization === 'object' && config.customization !== null) { + const { goback, close } = config.customization; + + if (typeof goback === 'object' && config.canBackToFolder !== false) { + const hasUrl = !!goback.url; + const requestClose = goback.requestClose && this.canRequestClose; + + canBack = close === undefined ? hasUrl || requestClose : hasUrl && !goback.requestClose; + + if (goback.requestClose) { console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead."); + } + } + + if (typeof close === 'object' && close !== null) { + this.canCloseEditor = !!close.visible && this.canRequestClose && !this.isDesktopApp; } - if (typeof config.customization.close === 'object') - this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp; } - this.canBack = this.canBackToFolder = !!_canback; + + this.canBack = this.canBackToFolder = canback; this.canPlugins = false; AscCommon.UserInfoParser.setParser(true); diff --git a/apps/spreadsheeteditor/mobile/src/view/settings/SettingsPage.jsx b/apps/spreadsheeteditor/mobile/src/view/settings/SettingsPage.jsx index 7b2b89e654..7b187c69b9 100644 --- a/apps/spreadsheeteditor/mobile/src/view/settings/SettingsPage.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/settings/SettingsPage.jsx @@ -14,6 +14,8 @@ const SettingsPage = inject('storeAppOptions', 'storeSpreadsheetInfo')(observer( const settingsContext = useContext(SettingsContext); const _t = t('View.Settings', {returnObjects: true}); const docTitle = storeSpreadsheetInfo.dataDoc?.title ?? ''; + const canCloseEditor = appOptions.canCloseEditor; + const closeButtonText = canCloseEditor && appOptions.customization.close.text; const navbar =
    {docTitle}
    @@ -123,6 +125,9 @@ const SettingsPage = inject('storeAppOptions', 'storeSpreadsheetInfo')(observer( } + {canCloseEditor && + Common.Notifications.trigger('close')}> + } ) From 14c33df9e125aefdf0156c62334fb9513011839e Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Thu, 22 Feb 2024 14:36:05 +0100 Subject: [PATCH 5/5] [DE PE SSE mobile] Correct variables --- apps/documenteditor/mobile/src/store/appOptions.js | 4 ++-- apps/presentationeditor/mobile/src/store/appOptions.js | 4 ++-- apps/spreadsheeteditor/mobile/src/store/appOptions.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index 0dd34acd73..416c6dd186 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -130,7 +130,7 @@ export class storeAppOptions { this.canRequestClose = config.canRequestClose; this.canCloseEditor = false; - let canback = false; + let canBack = false; if (typeof config.customization === 'object' && config.customization !== null) { const { goback, close } = config.customization; @@ -151,7 +151,7 @@ export class storeAppOptions { } } - this.canBack = this.canBackToFolder = canback; + this.canBack = this.canBackToFolder = canBack; this.canRequestSaveAs = config.canRequestSaveAs; this.canPlugins = false; this.canFeatureForms = !!Common.EditorApi.get().asc_isSupportFeature("forms"); diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js index f26133a688..fe2d42631d 100644 --- a/apps/presentationeditor/mobile/src/store/appOptions.js +++ b/apps/presentationeditor/mobile/src/store/appOptions.js @@ -64,7 +64,7 @@ export class storeAppOptions { this.canRequestClose = config.canRequestClose; this.canCloseEditor = false; - let canback = false; + let canBack = false; if (typeof config.customization === 'object' && config.customization !== null) { const { goback, close } = config.customization; @@ -85,7 +85,7 @@ export class storeAppOptions { } } - this.canBack = this.canBackToFolder = canback; + this.canBack = this.canBackToFolder = canBack; this.canPlugins = false; AscCommon.UserInfoParser.setParser(true); diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index 22d5b3034e..2368c65205 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -73,7 +73,7 @@ export class storeAppOptions { this.canRequestClose = config.canRequestClose; this.canCloseEditor = false; - let canback = false; + let canBack = false; if (typeof config.customization === 'object' && config.customization !== null) { const { goback, close } = config.customization; @@ -94,7 +94,7 @@ export class storeAppOptions { } } - this.canBack = this.canBackToFolder = canback; + this.canBack = this.canBackToFolder = canBack; this.canPlugins = false; AscCommon.UserInfoParser.setParser(true);