[desktop] refactoring
This commit is contained in:
parent
b9ba820887
commit
42e2ae9277
|
@ -60,10 +60,12 @@ define([
|
||||||
'btn-save-coauth': 'coauth',
|
'btn-save-coauth': 'coauth',
|
||||||
'btn-synch': 'synch' };
|
'btn-synch': 'synch' };
|
||||||
|
|
||||||
var is_win_xp = window.RendererProcessVariable && window.RendererProcessVariable.os === 'winxp';
|
var nativevars;
|
||||||
|
|
||||||
if ( !!native ) {
|
if ( !!native ) {
|
||||||
native.features = native.features || {};
|
native.features = native.features || {};
|
||||||
|
nativevars = window.RendererProcessVariable;
|
||||||
|
|
||||||
window.on_native_message = function (cmd, param) {
|
window.on_native_message = function (cmd, param) {
|
||||||
if (/^style:change/.test(cmd)) {
|
if (/^style:change/.test(cmd)) {
|
||||||
var obj = JSON.parse(param);
|
var obj = JSON.parse(param);
|
||||||
|
@ -207,6 +209,8 @@ define([
|
||||||
_.extend(config, opts);
|
_.extend(config, opts);
|
||||||
|
|
||||||
if ( config.isDesktopApp ) {
|
if ( config.isDesktopApp ) {
|
||||||
|
let is_win_xp = nativevars && nativevars.os === 'winxp';
|
||||||
|
|
||||||
Common.UI.Themes.setAvailable(!is_win_xp);
|
Common.UI.Themes.setAvailable(!is_win_xp);
|
||||||
Common.NotificationCenter.on('app:ready', function (opts) {
|
Common.NotificationCenter.on('app:ready', function (opts) {
|
||||||
_.extend(config, opts);
|
_.extend(config, opts);
|
||||||
|
|
|
@ -2088,12 +2088,12 @@ define([
|
||||||
store.fetch(config);
|
store.fetch(config);
|
||||||
} else {
|
} else {
|
||||||
if ( Common.Controllers.Desktop.isActive() ) {
|
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';
|
me.iFrame.src = '../../common/main/resources/help/download.html';
|
||||||
else {
|
else {
|
||||||
store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang;
|
store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang;
|
||||||
me.urlPref = `${Common.Controllers.Desktop.helpUrl()}/${lang}/`;
|
me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + lang + '/';
|
||||||
store.url = `${me.urlPref}/Contents.json`;
|
store.url = me.urlPref + '/Contents.json';
|
||||||
store.fetch(config);
|
store.fetch(config);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue