[desktop] fix bug 54335

This commit is contained in:
Maxim Kadushkin 2021-12-05 20:15:56 +03:00
parent 025218b048
commit 93db03e848

View file

@ -1809,6 +1809,7 @@ define([
// eventloading: true, // eventloading: true,
uithemes: true uithemes: true
}; };
var api;
var native = window.desktop || window.AscDesktopEditor; var native = window.desktop || window.AscDesktopEditor;
!!native && native.execCommand('webapps:features', JSON.stringify(features)); !!native && native.execCommand('webapps:features', JSON.stringify(features));
@ -1844,16 +1845,20 @@ define([
}); });
} }
Common.Gateway.on('opendocument', function () {
api = DE.getController('ApplicationController').api;
});
return { return {
isActive: function () { isActive: function () {
return !!native; return !!native;
}, },
process: function (opts) { process: function (opts) {
if ( !!native ) { if ( !!native && !!api ) {
if ( opts == 'goback' ) { if ( opts == 'goback' ) {
var config = DE.getController('ApplicationController').editorConfig; var config = DE.getController('ApplicationController').editorConfig;
native.execCommand('go:folder', native.execCommand('go:folder',
config.isOffline ? 'offline' : config.customization.goback.url); api.asc_isOffline() ? 'offline' : config.customization.goback.url);
return true; return true;
} }
} }