[Desktop] refactoring
This commit is contained in:
parent
57749f4fe1
commit
b823c308db
|
@ -278,23 +278,14 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
const _onAppReady = function (opts) {
|
||||||
init: function (opts) {
|
|
||||||
_.extend(config, opts);
|
|
||||||
|
|
||||||
if ( config.isDesktopApp ) {
|
|
||||||
const me = this;
|
|
||||||
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);
|
_.extend(config, opts);
|
||||||
!!native && native.execCommand('doc:onready', '');
|
!!native && native.execCommand('doc:onready', '');
|
||||||
|
|
||||||
$('.toolbar').addClass('editor-native-color');
|
$('.toolbar').addClass('editor-native-color');
|
||||||
});
|
}
|
||||||
|
|
||||||
Common.NotificationCenter.on('document:ready', function () {
|
const _onDocumentReady = function () {
|
||||||
if ( config.isEdit ) {
|
if ( config.isEdit ) {
|
||||||
function get_locked_message (t) {
|
function get_locked_message (t) {
|
||||||
switch (t) {
|
switch (t) {
|
||||||
|
@ -337,11 +328,11 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_checkHelpAvailable.call(me);
|
_checkHelpAvailable.call(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
Common.NotificationCenter.on('app:face', function (mode) {
|
const _onHidePreloader = function (mode) {
|
||||||
features.viewmode = !mode.isEdit;
|
features.viewmode = !mode.isEdit;
|
||||||
features.crypted = mode.isCrypted;
|
features.crypted = mode.isCrypted;
|
||||||
native.execCommand('webapps:features', JSON.stringify(features));
|
native.execCommand('webapps:features', JSON.stringify(features));
|
||||||
|
@ -426,9 +417,20 @@ define([
|
||||||
// $('#box-document-title .hedset')[native.features.singlewindow ? 'hide' : 'show']();
|
// $('#box-document-title .hedset')[native.features.singlewindow ? 'hide' : 'show']();
|
||||||
!!titlebuttons.home && titlebuttons.home.btn.setVisible(native.features.singlewindow);
|
!!titlebuttons.home && titlebuttons.home.btn.setVisible(native.features.singlewindow);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
init: function (opts) {
|
||||||
|
_.extend(config, opts);
|
||||||
|
|
||||||
|
if ( config.isDesktopApp ) {
|
||||||
|
let is_win_xp = nativevars && nativevars.os === 'winxp';
|
||||||
|
|
||||||
|
Common.UI.Themes.setAvailable(!is_win_xp);
|
||||||
Common.NotificationCenter.on({
|
Common.NotificationCenter.on({
|
||||||
|
'app:ready': _onAppReady,
|
||||||
|
'document:ready': _onDocumentReady.bind(this),
|
||||||
|
'app:face': _onHidePreloader.bind(this),
|
||||||
'modal:show': _onModalDialog.bind(this, 'open'),
|
'modal:show': _onModalDialog.bind(this, 'open'),
|
||||||
'modal:close': _onModalDialog.bind(this, 'close'),
|
'modal:close': _onModalDialog.bind(this, 'close'),
|
||||||
'modal:hide': _onModalDialog.bind(this, 'hide'),
|
'modal:hide': _onModalDialog.bind(this, 'hide'),
|
||||||
|
|
Loading…
Reference in a new issue