[forms] fix bug 61142

This commit is contained in:
maxkadushkin
2023-02-10 21:10:57 +03:00
parent 701b561271
commit ce7c49e815

View File

@ -1967,7 +1967,7 @@ define([
uitype: 'fillform',
uithemes: true
};
var api;
var api, nativevars;
var native = window.desktop || window.AscDesktopEditor;
!!native && native.execCommand('webapps:features', JSON.stringify(features));
@ -1975,6 +1975,8 @@ define([
if ( !!native ) {
$('#header-logo, .brand-logo').hide();
nativevars = window.RendererProcessVariable;
window.on_native_message = function (cmd, param) {
if (/theme:changed/.test(cmd)) {
if ( Common.UI.Themes && !!Common.UI.Themes.setTheme )
@ -2021,6 +2023,9 @@ define([
isActive: function () {
return !!native;
},
isOffline: function () {
return api && api.asc_isOffline();
},
process: function (opts) {
if ( !!native && !!api ) {
if ( opts == 'goback' ) {
@ -2033,6 +2038,10 @@ define([
return false;
},
systemThemeType: function () {
return nativevars.theme && !!nativevars.theme.system ? nativevars.theme.system :
window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
},
}
};
DE.Controllers.Desktop = new Desktop();