From 93db03e84850da4e8db0a8d80816d00ef01cd477 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sun, 5 Dec 2021 20:15:56 +0300 Subject: [PATCH] [desktop] fix bug 54335 --- .../forms/app/controller/ApplicationController.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index eea2ad09c..7466238f0 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -1809,6 +1809,7 @@ define([ // eventloading: true, uithemes: true }; + var api; var native = window.desktop || window.AscDesktopEditor; !!native && native.execCommand('webapps:features', JSON.stringify(features)); @@ -1844,16 +1845,20 @@ define([ }); } + Common.Gateway.on('opendocument', function () { + api = DE.getController('ApplicationController').api; + }); + return { isActive: function () { return !!native; }, process: function (opts) { - if ( !!native ) { + if ( !!native && !!api ) { if ( opts == 'goback' ) { var config = DE.getController('ApplicationController').editorConfig; native.execCommand('go:folder', - config.isOffline ? 'offline' : config.customization.goback.url); + api.asc_isOffline() ? 'offline' : config.customization.goback.url); return true; } }