diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 6e633ecac1..998b03f55c 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -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();