[desktop] for bug 53723

This commit is contained in:
Maxim Kadushkin 2021-11-16 22:26:34 +03:00
parent 88397446a0
commit eb1d1d7191
2 changed files with 34 additions and 1 deletions

View file

@ -251,6 +251,17 @@ define([
native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type}));
}
});
webapp.addListeners({
'FileMenu': {
'item:click': function (menu, action, isopts) {
if ( action == 'app:exit' ) {
native.execCommand('editor:event', JSON.stringify({action: 'close'}));
menu.hide();
}
},
},
}, {id: 'desktop'});
}
},
process: function (opts) {
@ -278,7 +289,14 @@ define([
if ( config.isDesktopApp && !!native ) {
native.execCommand('editor:event', JSON.stringify({action:'close', url: config.customization.goback.url}));
}
}
},
isActive: function () {
return !!native;
},
isOffline: function () {
// return webapp.getController('Main').api.asc_isOffline();
return webapp.getController('Main').appOptions.isOffline;
},
};
};

View file

@ -419,6 +419,21 @@ define([
}
this.miHistory[this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide']();
if ( Common.Controllers.Desktop.isActive() ) {
$('<li class="devider" />' +
'<li id="fm-btn-exit" class="fm-btn"/>').insertAfter($('#fm-btn-back', this.$el));
this.items.push(
new Common.UI.MenuItem({
el : $('#fm-btn-exit', this.$el),
action : 'app:exit',
caption : 'Exit',
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}));
}
},
setMode: function(mode, delay) {