[DE] Fix disable buttons in view tab

This commit is contained in:
JuliaSvinareva 2021-12-13 16:50:36 +03:00
parent 6633548659
commit b20b3ceff5
2 changed files with 38 additions and 28 deletions

View file

@ -123,33 +123,38 @@ define([
accept();
})).then(function(){
me.view.setEvents();
});
me.getApplication().getController('LeftMenu').leftMenu.btnNavigation.on('toggle', function (btn, state) {
if (state !== me.view.btnNavigation.pressed)
me.view.turnNavigation(state);
});
var menuItems = [],
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
for (var t in Common.UI.Themes.map()) {
menuItems.push({
value: t,
caption: Common.UI.Themes.get(t).text,
checked: t === currentTheme,
checkable: true,
toggleGroup: 'interface-theme'
me.getApplication().getController('LeftMenu').leftMenu.btnNavigation.on('toggle', function (btn, state) {
if (state !== me.view.btnNavigation.pressed)
me.view.turnNavigation(state);
});
}
if (menuItems.length) {
this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems}));
this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) {
var value = item.value;
Common.UI.Themes.setTheme(value);
this.view.btnDarkDocument.setDisabled(value !== 'theme-dark');
}, this));
}
var menuItems = [],
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
for (var t in Common.UI.Themes.map()) {
menuItems.push({
value: t,
caption: Common.UI.Themes.get(t).text,
checked: t === currentTheme,
checkable: true,
toggleGroup: 'interface-theme'
});
}
if (menuItems.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);
me.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme());
}, me));
setTimeout(function () {
me.onContentThemeChangedToDark(Common.UI.Themes.isContentThemeDark());
me.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme());
}, 0);
}
});
}
},

View file

@ -93,6 +93,7 @@ define([
iconCls: 'toolbar__icon btn-menu-navigation',
caption: this.textNavigation,
enableToggle: true,
disabled: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
@ -104,7 +105,7 @@ define([
cls: 'input-group-nr',
menuStyle: 'min-width: 55px;',
editable: false,
//lock: [_set.coAuth, _set.lostConnect, _set.editCell],
disabled: true,
data: [
{ displayValue: "50%", value: 50 },
{ displayValue: "75%", value: 75 },
@ -130,6 +131,7 @@ define([
caption: this.textFitToPage,
toggleGroup: 'view-zoom',
enableToggle: true,
disabled: true,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'medium'
@ -143,6 +145,7 @@ define([
caption: this.textFitToWidth,
toggleGroup: 'view-zoom',
enableToggle: true,
disabled: true,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'medium'
@ -155,6 +158,7 @@ define([
iconCls: 'toolbar__icon day',
caption: this.textInterfaceTheme,
menu: true,
disabled: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
@ -167,6 +171,7 @@ define([
iconCls: 'toolbar__icon night',
caption: this.textDarkDocument,
enableToggle: true,
disabled: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
@ -177,7 +182,7 @@ define([
el: $host.findById('#slot-chk-statusbar'),
labelText: this.textStatusBar,
value: !Common.localStorage.getBool("de-hidden-status"),
//lock: [_set.lostConnect, _set.coAuth, _set.editCell],
disabled: true,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
@ -188,7 +193,7 @@ define([
el: $host.findById('#slot-chk-toolbar'),
labelText: this.textAlwaysShowToolbar,
value: !options.compactToolbar,
//lock: [_set.lostConnect, _set.coAuth, _set.editCell],
disabled: true,
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
@ -199,7 +204,7 @@ define([
el: $host.findById('#slot-chk-rulers'),
labelText: this.textRulers,
value: !Common.Utils.InternalSettings.get("de-hidden-rulers"),
//lock: [_set.lostConnect, _set.coAuth, _set.editCell],
disabled: true,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'