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