From 73dea87360fae963e0c05ab0f07455e862fcc144 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 30 Nov 2021 00:34:20 +0300 Subject: [PATCH] [desktop] for bug 53723 --- apps/common/main/lib/controller/Desktop.js | 8 ++++++-- apps/documenteditor/main/app/view/FileMenu.js | 20 ++++++++++++++++--- apps/documenteditor/main/locale/en.json | 2 ++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 5a4c6a9ef..19cf250e4 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -255,8 +255,12 @@ define([ webapp.addListeners({ 'FileMenu': { 'item:click': function (menu, action, isopts) { - if ( action == 'app:exit' ) { - native.execCommand('editor:event', JSON.stringify({action: 'close'})); + if ( action == 'file:exit' ) { + native.execCommand('editor:event', JSON.stringify({action: 'file:exit'})); + menu.hide(); + } else + if ( action == 'file:open' ) { + native.execCommand('editor:event', JSON.stringify({action: 'file:open'})); menu.hide(); } }, diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 130972c77..df1faebee 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -421,13 +421,25 @@ define([ this.miHistory[this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide'](); if ( Common.Controllers.Desktop.isActive() ) { + $('
  • ').insertAfter($('#fm-btn-recent', this.$el)); + this.items.push( + new Common.UI.MenuItem({ + el : $('#fm-btn-local-open', this.$el), + action : 'file:open', + caption : this.btnFileOpenCaption, + canFocused: false, + dataHint: 1, + dataHintDirection: 'left-top', + dataHintOffset: [2, 14] + })); + $('
  • ' + '
  • ').insertAfter($('#fm-btn-back', this.$el)); this.items.push( new Common.UI.MenuItem({ el : $('#fm-btn-exit', this.$el), - action : 'app:exit', - caption : 'Exit', + action : 'file:exit', + caption : this.btnExitCaption, canFocused: false, dataHint: 1, dataHintDirection: 'left-top', @@ -567,6 +579,8 @@ define([ btnRenameCaption : 'Rename...', btnCloseMenuCaption : 'Close Menu', btnProtectCaption: 'Protect', - btnSaveCopyAsCaption : 'Save Copy as...' + btnSaveCopyAsCaption : 'Save Copy as...', + btnExitCaption : 'Exit', + btnFileOpenCaption : 'Open...' }, DE.Views.FileMenu || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index fb17e2cb5..774e0a3fd 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1661,6 +1661,8 @@ "DE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy as...", "DE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...", "DE.Views.FileMenu.btnToEditCaption": "Edit Document", + "DE.Views.FileMenu.btnExitCaption": "Exit", + "DE.Views.FileMenu.btnFileOpenCaption": "Open...", "DE.Views.FileMenu.textDownload": "Download", "DE.Views.FileMenuPanels.CreateNew.txtBlank": "Blank Document", "DE.Views.FileMenuPanels.CreateNew.txtCreateNew": "Create New",