[themes] fix for View tab
This commit is contained in:
parent
66dc610faf
commit
730ea07cc6
|
@ -157,10 +157,14 @@ define([
|
|||
});
|
||||
|
||||
if (Common.UI.Themes.available()) {
|
||||
var menuItems = [],
|
||||
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
function _fill_themes() {
|
||||
var btn = this.view.btnInterfaceTheme;
|
||||
if ( typeof(btn.menu) == 'object' ) btn.menu.removeAll();
|
||||
else btn.setMenu(new Common.UI.Menu());
|
||||
|
||||
var currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
for (var t in Common.UI.Themes.map()) {
|
||||
menuItems.push({
|
||||
btn.menu.addItem({
|
||||
value: t,
|
||||
caption: Common.UI.Themes.get(t).text,
|
||||
checked: t === currentTheme,
|
||||
|
@ -168,9 +172,13 @@ define([
|
|||
toggleGroup: 'interface-theme'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (menuItems.length) {
|
||||
me.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems}));
|
||||
Common.NotificationCenter.on('uitheme:countchanged', _fill_themes.bind(me));
|
||||
_fill_themes.call(me);
|
||||
|
||||
if (me.view.btnInterfaceTheme.menu.items.length) {
|
||||
// me.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems}));
|
||||
me.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) {
|
||||
var value = item.value;
|
||||
Common.UI.Themes.setTheme(value);
|
||||
|
|
|
@ -177,10 +177,14 @@ define([
|
|||
});
|
||||
|
||||
if (Common.UI.Themes.available()) {
|
||||
var menuItems = [],
|
||||
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
function _fill_themes() {
|
||||
var btn = this.view.btnInterfaceTheme;
|
||||
if ( typeof(btn.menu) == 'object' ) btn.menu.removeAll();
|
||||
else btn.setMenu(new Common.UI.Menu());
|
||||
|
||||
var currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
for (var t in Common.UI.Themes.map()) {
|
||||
menuItems.push({
|
||||
btn.menu.addItem({
|
||||
value: t,
|
||||
caption: Common.UI.Themes.get(t).text,
|
||||
checked: t === currentTheme,
|
||||
|
@ -188,9 +192,12 @@ define([
|
|||
toggleGroup: 'interface-theme'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (menuItems.length) {
|
||||
this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems}));
|
||||
Common.NotificationCenter.on('uitheme:countchanged', _fill_themes.bind(me));
|
||||
_fill_themes.call(me);
|
||||
|
||||
if (me.view.btnInterfaceTheme.menu.items.length) {
|
||||
this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) {
|
||||
var value = item.value;
|
||||
Common.UI.Themes.setTheme(value);
|
||||
|
|
|
@ -401,10 +401,14 @@ define([
|
|||
}
|
||||
}
|
||||
if (Common.UI.Themes.available()) {
|
||||
var menuItems = [],
|
||||
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
function _fill_themes() {
|
||||
var btn = this.btnInterfaceTheme;
|
||||
if ( typeof(btn.menu) == 'object' ) btn.menu.removeAll();
|
||||
else btn.setMenu(new Common.UI.Menu());
|
||||
|
||||
var currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
|
||||
for (var t in Common.UI.Themes.map()) {
|
||||
menuItems.push({
|
||||
btn.menu.addItem({
|
||||
value: t,
|
||||
caption: Common.UI.Themes.get(t).text,
|
||||
checked: t === currentTheme,
|
||||
|
@ -412,7 +416,12 @@ define([
|
|||
toggleGroup: 'interface-theme'
|
||||
});
|
||||
}
|
||||
if (menuItems.length) {
|
||||
}
|
||||
|
||||
Common.NotificationCenter.on('uitheme:countchanged', _fill_themes.bind(me));
|
||||
_fill_themes.call(me);
|
||||
|
||||
if (me.view.btnInterfaceTheme.menu.items.length) {
|
||||
me.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems}));
|
||||
me.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) {
|
||||
var value = item.value;
|
||||
|
|
Loading…
Reference in a new issue