Merge pull request #1464 from ONLYOFFICE/fix/fix-bugs

Fix/fix bugs
This commit is contained in:
Julia Radzhabova 2022-01-12 18:17:20 +03:00 committed by GitHub
commit c544e250c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 12 deletions

View file

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

View file

@ -72,12 +72,22 @@ define([
}, },
setConfig: function(config) { setConfig: function(config) {
var mode = config.mode;
this.toolbar = config.toolbar; this.toolbar = config.toolbar;
this.view = this.createView('ViewTab', { this.view = this.createView('ViewTab', {
toolbar: this.toolbar.toolbar, toolbar: this.toolbar.toolbar,
mode: config.mode, mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView compactToolbar: this.toolbar.toolbar.isCompactView
}); });
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,
groupRulers = slotChkRulers.closest('.group'),
groupToolbar = this.view.chToolbar.$el.closest('.group');
groupToolbar.find('.elset')[1].append(slotChkRulers[0]);
groupRulers.remove();
this.view.cmpEl.find('.separator-rulers').remove();
}
this.addListeners({ this.addListeners({
'ViewTab': { 'ViewTab': {
'zoom:topage': _.bind(this.onBtnZoomTo, this, 'topage'), 'zoom:topage': _.bind(this.onBtnZoomTo, this, 'topage'),

View file

@ -202,14 +202,14 @@
</div> </div>
<div class="separator long"></div> <div class="separator long"></div>
<div class="group small"> <div class="group small">
<div class="elset">
<span class="btn-slot text" id="slot-chk-statusbar"></span>
</div>
<div class="elset"> <div class="elset">
<span class="btn-slot text" id="slot-chk-toolbar"></span> <span class="btn-slot text" id="slot-chk-toolbar"></span>
</div> </div>
<div class="elset">
<span class="btn-slot text" id="slot-chk-statusbar"></span>
</div>
</div> </div>
<div class="separator long"></div> <div class="separator long separator-rulers"></div>
<div class="group small"> <div class="group small">
<div class="elset"> <div class="elset">
<span class="btn-slot text" id="slot-chk-rulers"></span> <span class="btn-slot text" id="slot-chk-rulers"></span>

View file

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

View file

@ -74,12 +74,16 @@ define([
}, },
setConfig: function(config) { setConfig: function(config) {
var mode = config.mode;
this.toolbar = config.toolbar; this.toolbar = config.toolbar;
this.view = this.createView('ViewTab', { this.view = this.createView('ViewTab', {
toolbar: this.toolbar.toolbar, toolbar: this.toolbar.toolbar,
mode: config.mode, mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView compactToolbar: this.toolbar.toolbar.isCompactView
}); });
if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
this.view.chStatusbar.$el.remove();
}
this.addListeners({ this.addListeners({
'ViewTab': { 'ViewTab': {
'zoom:toslide': _.bind(this.onBtnZoomTo, this, 'toslide'), 'zoom:toslide': _.bind(this.onBtnZoomTo, this, 'toslide'),

View file

@ -211,10 +211,10 @@
<div class="separator long"></div> <div class="separator long"></div>
<div class="group small"> <div class="group small">
<div class="elset"> <div class="elset">
<span class="btn-slot text" id="slot-chk-statusbar"></span> <span class="btn-slot text" id="slot-chk-toolbar"></span>
</div> </div>
<div class="elset"> <div class="elset">
<span class="btn-slot text" id="slot-chk-toolbar"></span> <span class="btn-slot text" id="slot-chk-statusbar"></span>
</div> </div>
</div> </div>
</section> </section>

View file

@ -78,11 +78,15 @@ define([
setConfig: function(config) { setConfig: function(config) {
this.toolbar = config.toolbar; this.toolbar = config.toolbar;
var mode = config.mode;
this.view = this.createView('ViewTab', { this.view = this.createView('ViewTab', {
toolbar: this.toolbar.toolbar, toolbar: this.toolbar.toolbar,
mode: config.mode, mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView compactToolbar: this.toolbar.toolbar.isCompactView
}); });
if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
this.view.chStatusbar.$el.remove();
}
this.addListeners({ this.addListeners({
'ViewTab': { 'ViewTab': {
'zoom:selected': _.bind(this.onSelectedZoomValue, this), 'zoom:selected': _.bind(this.onSelectedZoomValue, this),

View file

@ -294,10 +294,10 @@
<div class="separator long"></div> <div class="separator long"></div>
<div class="group small"> <div class="group small">
<div class="elset"> <div class="elset">
<span class="btn-slot text" id="slot-chk-statusbar"></span> <span class="btn-slot text" id="slot-chk-toolbar"></span>
</div> </div>
<div class="elset"> <div class="elset">
<span class="btn-slot text" id="slot-chk-toolbar"></span> <span class="btn-slot text" id="slot-chk-statusbar"></span>
</div> </div>
</div> </div>
</section> </section>