From 42e2ae92772ac47f969db6dc57663a2e4e3d7e1c Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 9 Jun 2022 10:36:56 +0300 Subject: [PATCH] [desktop] refactoring --- apps/common/main/lib/controller/Desktop.js | 6 +++++- apps/documenteditor/main/app/view/FileMenuPanels.js | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index b6a03bbed9..1d7fdfd37e 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -60,10 +60,12 @@ define([ 'btn-save-coauth': 'coauth', 'btn-synch': 'synch' }; - var is_win_xp = window.RendererProcessVariable && window.RendererProcessVariable.os === 'winxp'; + var nativevars; if ( !!native ) { native.features = native.features || {}; + nativevars = window.RendererProcessVariable; + window.on_native_message = function (cmd, param) { if (/^style:change/.test(cmd)) { var obj = JSON.parse(param); @@ -207,6 +209,8 @@ define([ _.extend(config, opts); if ( config.isDesktopApp ) { + let is_win_xp = nativevars && nativevars.os === 'winxp'; + Common.UI.Themes.setAvailable(!is_win_xp); Common.NotificationCenter.on('app:ready', function (opts) { _.extend(config, opts); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index caa4bb7108..9efe54cac9 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -2088,12 +2088,12 @@ define([ store.fetch(config); } else { if ( Common.Controllers.Desktop.isActive() ) { - if ( store.contentLang === '{{DEFAULT_LANG}}' ) + if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) me.iFrame.src = '../../common/main/resources/help/download.html'; else { store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; - me.urlPref = `${Common.Controllers.Desktop.helpUrl()}/${lang}/`; - store.url = `${me.urlPref}/Contents.json`; + me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + lang + '/'; + store.url = me.urlPref + '/Contents.json'; store.fetch(config); } } else {