From 86a808ba4f842f57a3f36d9509943be7a2498fdc Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Fri, 29 Mar 2019 16:01:46 +0300 Subject: [PATCH] [all] share some config to desktop --- apps/common/main/lib/controller/Desktop.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 761da1284..f4bc0c137 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -57,17 +57,23 @@ define([ $('.toolbar').addClass('editor-native-color'); }); - !!app && (app.on_native_message = function (cmd, param) { - if (/^style:change/.test(cmd)) { - var obj = JSON.parse(param); + if ( !!app ) { + if ( !config.isOffline ) { + app.execCommand('webapps:config', 'goback:' + config.customization.goback.url); + } - if ( obj.element == 'toolbar' ) { - if ( obj.action == 'off' && obj.style == 'native-color' ) { - $('.toolbar').removeClass('editor-native-color'); + app.on_native_message = function (cmd, param) { + if (/^style:change/.test(cmd)) { + var obj = JSON.parse(param); + + if ( obj.element == 'toolbar' ) { + if ( obj.action == 'off' && obj.style == 'native-color' ) { + $('.toolbar').removeClass('editor-native-color'); + } } } - } - }); + }; + } } }, process: function (opts) {