Fix Bug 57038

This commit is contained in:
Julia Radzhabova 2022-05-06 11:33:48 +03:00
parent 90e4b2485d
commit 6f22f43245
8 changed files with 84 additions and 65 deletions

View file

@ -79,6 +79,10 @@ define([
mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView
});
if (!Common.UI.Themes.available()) {
this.view.btnInterfaceTheme.$el.closest('.group').remove();
this.view.cmpEl.find('.separator-theme').remove();
}
if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
this.view.chStatusbar.$el.remove();
var slotChkRulers = this.view.chRulers.$el,
@ -144,6 +148,7 @@ define([
me.view.turnNavigation(state);
});
if (Common.UI.Themes.available()) {
var menuItems = [],
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
for (var t in Common.UI.Themes.map()) {
@ -169,6 +174,7 @@ define([
me.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme());
}, 0);
}
}
});
}
},
@ -243,7 +249,7 @@ define([
},
onThemeChanged: function () {
if (this.view) {
if (this.view && Common.UI.Themes.available()) {
var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(),
menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme});
if ( menu_item ) {

View file

@ -200,7 +200,7 @@
<span class="btn-slot text x-huge" id="slot-btn-interface-theme"></span>
<span class="btn-slot text x-huge" id="slot-btn-dark-document"></span>
</div>
<div class="separator long"></div>
<div class="separator long separator-theme"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot text" id="slot-chk-toolbar"></span>

View file

@ -81,6 +81,10 @@ define([
mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView
});
if (!Common.UI.Themes.available()) {
this.view.btnInterfaceTheme.$el.closest('.group').remove();
this.view.cmpEl.find('.separator-theme').remove();
}
if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
this.view.chStatusbar.$el.remove();
}
@ -89,7 +93,7 @@ define([
'zoom:toslide': _.bind(this.onBtnZoomTo, this, 'toslide'),
'zoom:towidth': _.bind(this.onBtnZoomTo, this, 'towidth'),
'rulers:change': _.bind(this.onChangeRulers, this),
'notes:change': _.bind(this.onChangeNotes, this),
'notes:change': _.bind(this.onChangeNotes, this)
},
'Toolbar': {
'view:compact': _.bind(function (toolbar, state) {
@ -150,6 +154,7 @@ define([
.on('combo:blur', _.bind(me.onComboBlur, me, false));
});
if (Common.UI.Themes.available()) {
var menuItems = [],
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
for (var t in Common.UI.Themes.map()) {
@ -170,6 +175,7 @@ define([
}, this));
}
}
}
},
onBtnZoomTo: function (type, btn) {
@ -199,7 +205,7 @@ define([
},
onThemeChanged: function () {
if (this.view) {
if (this.view && Common.UI.Themes.available()) {
var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(),
menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme});
if ( !!menu_item ) {

View file

@ -199,7 +199,7 @@
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-interface-theme"></span>
</div>
<div class="separator long"></div>
<div class="separator long separator-theme"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot text" id="slot-chk-notes"></span>

View file

@ -195,6 +195,8 @@ define([
dataHintOffset: 'small'
});
this.lockedControls.push(this.chNotes);
this.cmpEl = $host;
},
render: function (el) {

View file

@ -84,6 +84,10 @@ define([
mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView
});
if (!Common.UI.Themes.available()) {
this.view.btnInterfaceTheme.$el.closest('.group').remove();
this.view.cmpEl.find('.separator-theme').remove();
}
if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
this.view.chStatusbar.$el.remove();
}
@ -281,7 +285,7 @@ define([
},
onThemeChanged: function () {
if (this.view) {
if (this.view && Common.UI.Themes.available()) {
var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(),
menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme});
if ( !!menu_item ) {

View file

@ -270,7 +270,7 @@
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-interface-theme"></span>
</div>
<div class="separator long"></div>
<div class="separator long separator-theme"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-freeze"></span>
</div>

View file

@ -264,7 +264,7 @@ define([
this.lockedControls.push(this.chToolbar);
$host.find('#slot-lbl-zoom').text(this.textZoom);
this.cmpEl = $host;
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
},
@ -312,6 +312,7 @@ define([
}));
me.btnFreezePanes.updateHint(me.tipFreeze);
if (Common.UI.Themes.available()) {
var menuItems = [],
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
for (var t in Common.UI.Themes.map()) {
@ -331,7 +332,7 @@ define([
Common.UI.Themes.setTheme(value);
}, me));
}
}
setEvents.call(me);
});
},