[desktop] refactoring

This commit is contained in:
Maxim Kadushkin 2022-06-09 10:36:56 +03:00
parent b9ba820887
commit 42e2ae9277
2 changed files with 8 additions and 4 deletions

View file

@ -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);

View file

@ -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 {