[DE PE SSE] Fix change of themes in view tab
This commit is contained in:
parent
c97440e676
commit
24910d5651
|
@ -61,6 +61,7 @@ define([
|
|||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
Common.NotificationCenter.on('contenttheme:dark', this.onContentThemeChangedToDark.bind(this));
|
||||
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
|
||||
Common.NotificationCenter.on('uitheme:countchanged', this.onThemeCountChanged.bind(this));
|
||||
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
|
||||
},
|
||||
|
||||
|
@ -271,6 +272,23 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onThemeCountChanged: function () {
|
||||
if (this.view && Common.UI.Themes.available()) {
|
||||
this.view.btnInterfaceTheme.menu.removeAll();
|
||||
var currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
for (var t in Common.UI.Themes.map()) {
|
||||
var item = {
|
||||
value: t,
|
||||
caption: Common.UI.Themes.get(t).text,
|
||||
checked: t === currentTheme,
|
||||
checkable: true,
|
||||
toggleGroup: 'interface-theme'
|
||||
};
|
||||
this.view.btnInterfaceTheme.menu.addItem(item);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onComboBlur: function() {
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ define([
|
|||
};
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
|
||||
Common.NotificationCenter.on('uitheme:countchanged', this.onThemeCountChanged.bind(this));
|
||||
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
|
||||
},
|
||||
|
||||
|
@ -235,6 +236,23 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onThemeCountChanged: function () {
|
||||
if (this.view && Common.UI.Themes.available()) {
|
||||
this.view.btnInterfaceTheme.menu.removeAll();
|
||||
var currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
for (var t in Common.UI.Themes.map()) {
|
||||
var item = {
|
||||
value: t,
|
||||
caption: Common.UI.Themes.get(t).text,
|
||||
checked: t === currentTheme,
|
||||
checkable: true,
|
||||
toggleGroup: 'interface-theme'
|
||||
};
|
||||
this.view.btnInterfaceTheme.menu.addItem(item);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
applyZoom: function (value) {
|
||||
this._state.zoom_percent = undefined;
|
||||
this._state.zoom_type = undefined;
|
||||
|
|
|
@ -60,6 +60,7 @@ define([
|
|||
onLaunch: function () {
|
||||
this._state = {};
|
||||
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
|
||||
Common.NotificationCenter.on('uitheme:countchanged', this.onThemeCountChanged.bind(this));
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
|
@ -283,7 +284,24 @@ define([
|
|||
menu_item.setChecked(true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onThemeCountChanged: function () {
|
||||
if (this.view && Common.UI.Themes.available()) {
|
||||
this.view.btnInterfaceTheme.menu.removeAll();
|
||||
var currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
for (var t in Common.UI.Themes.map()) {
|
||||
var item = {
|
||||
value: t,
|
||||
caption: Common.UI.Themes.get(t).text,
|
||||
checked: t === currentTheme,
|
||||
checkable: true,
|
||||
toggleGroup: 'interface-theme'
|
||||
};
|
||||
this.view.btnInterfaceTheme.menu.addItem(item);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}, SSE.Controllers.ViewTab || {}));
|
||||
});
|
Loading…
Reference in a new issue