[desktop] for bug 53723

This commit is contained in:
Maxim Kadushkin 2021-11-30 00:34:20 +03:00
parent de72480047
commit 73dea87360
3 changed files with 25 additions and 5 deletions

View file

@ -255,8 +255,12 @@ define([
webapp.addListeners({ webapp.addListeners({
'FileMenu': { 'FileMenu': {
'item:click': function (menu, action, isopts) { 'item:click': function (menu, action, isopts) {
if ( action == 'app:exit' ) { if ( action == 'file:exit' ) {
native.execCommand('editor:event', JSON.stringify({action: 'close'})); 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(); menu.hide();
} }
}, },

View file

@ -421,13 +421,25 @@ define([
this.miHistory[this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide'](); this.miHistory[this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide']();
if ( Common.Controllers.Desktop.isActive() ) { if ( Common.Controllers.Desktop.isActive() ) {
$('<li id="fm-btn-local-open" class="fm-btn"/>').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]
}));
$('<li class="devider" />' + $('<li class="devider" />' +
'<li id="fm-btn-exit" class="fm-btn"/>').insertAfter($('#fm-btn-back', this.$el)); '<li id="fm-btn-exit" class="fm-btn"/>').insertAfter($('#fm-btn-back', this.$el));
this.items.push( this.items.push(
new Common.UI.MenuItem({ new Common.UI.MenuItem({
el : $('#fm-btn-exit', this.$el), el : $('#fm-btn-exit', this.$el),
action : 'app:exit', action : 'file:exit',
caption : 'Exit', caption : this.btnExitCaption,
canFocused: false, canFocused: false,
dataHint: 1, dataHint: 1,
dataHintDirection: 'left-top', dataHintDirection: 'left-top',
@ -567,6 +579,8 @@ define([
btnRenameCaption : 'Rename...', btnRenameCaption : 'Rename...',
btnCloseMenuCaption : 'Close Menu', btnCloseMenuCaption : 'Close Menu',
btnProtectCaption: 'Protect', btnProtectCaption: 'Protect',
btnSaveCopyAsCaption : 'Save Copy as...' btnSaveCopyAsCaption : 'Save Copy as...',
btnExitCaption : 'Exit',
btnFileOpenCaption : 'Open...'
}, DE.Views.FileMenu || {})); }, DE.Views.FileMenu || {}));
}); });

View file

@ -1661,6 +1661,8 @@
"DE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy as...", "DE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy as...",
"DE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...", "DE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...",
"DE.Views.FileMenu.btnToEditCaption": "Edit Document", "DE.Views.FileMenu.btnToEditCaption": "Edit Document",
"DE.Views.FileMenu.btnExitCaption": "Exit",
"DE.Views.FileMenu.btnFileOpenCaption": "Open...",
"DE.Views.FileMenu.textDownload": "Download", "DE.Views.FileMenu.textDownload": "Download",
"DE.Views.FileMenuPanels.CreateNew.txtBlank": "Blank Document", "DE.Views.FileMenuPanels.CreateNew.txtBlank": "Blank Document",
"DE.Views.FileMenuPanels.CreateNew.txtCreateNew": "Create New", "DE.Views.FileMenuPanels.CreateNew.txtCreateNew": "Create New",