[DE] Fix disabling of dark document button in view tab

This commit is contained in:
JuliaSvinareva 2022-01-12 01:32:04 +03:00
parent 47b5e9d322
commit c2d5af84c8
2 changed files with 3 additions and 1 deletions

View file

@ -2910,6 +2910,7 @@ define([
this.toolbar.btnRedo.setDisabled(this._state.can_redo!==true);
this.toolbar.btnCopy.setDisabled(this._state.can_copycut!==true);
this.toolbar.btnPrint.setDisabled(!this.toolbar.mode.canPrint);
this.toolbar.btnDarkDocument && this.toolbar.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme());
if (!this._state.mmdisable) {
this.toolbar.btnMailRecepients.setDisabled(false);
this.toolbar.mnuMailRecepients.items[2].setVisible(this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients);
@ -3240,6 +3241,7 @@ define([
var viewtab = me.getApplication().getController('ViewTab');
viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
Array.prototype.push.apply(me.toolbar.toolbarControls, viewtab.getView('ViewTab').getButtons());
me.toolbar.btnDarkDocument = viewtab.getView('ViewTab').btnDarkDocument;
}
if ( config.isEdit && config.canFeatureContentControl && config.canFeatureForms || config.isRestrictedEdit && config.canFillForms ) {
if (config.isFormCreator) {

View file

@ -178,7 +178,6 @@ define([
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.lockedControls.push(this.btnDarkDocument);
this.chStatusbar = new Common.UI.CheckBox({
el: $host.findById('#slot-chk-statusbar'),
@ -235,6 +234,7 @@ define([
button.setDisabled(state);
}
}, this);
this.btnDarkDocument && this.btnDarkDocument.setDisabled(state);
},
turnNavigation: function (state) {