Merge pull request #1340 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2021-11-22 21:30:23 +03:00 committed by GitHub
commit f7187db16a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 31 deletions

View file

@ -1445,8 +1445,6 @@ define([
this.textMenu.items[0].setDisabled(!cancopy); // copy
this.textMenu.items[1].setDisabled(disabled || !cancopy); // cut
this.textMenu.items[2].setDisabled(disabled) // paste;
this.textMenu.items[3].setVisible(this.appOptions.canPrint);
this.textMenu.items[3].setDisabled(!cancopy);
this.showPopupMenu(this.textMenu, {}, event);
}
@ -1470,13 +1468,6 @@ define([
}
}
break;
case 'print':
var printopt = new Asc.asc_CAdjustPrint();
printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection);
var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event
opts.asc_setAdvancedOptions(printopt);
this.api.asc_Print(opts);
break;
}
},

View file

@ -92,8 +92,7 @@ define([
items: [
{ caption: this.textCut, value: 'cut', iconCls: 'mi-icon svg-icon cut' },
{ caption: this.textCopy, value: 'copy', iconCls: 'mi-icon svg-icon copy' },
{ caption: this.textPaste, value: 'paste', iconCls: 'mi-icon svg-icon paste' },
{ caption: this.textPrintSel, value: 'print', iconCls: 'mi-icon svg-icon print' }
{ caption: this.textPaste, value: 'paste', iconCls: 'mi-icon svg-icon paste' }
]
});
},

View file

@ -1219,19 +1219,20 @@ define([
this.txtNewValue.setValue(record.get('name'));
this._state.listValue = record.get('name');
this._state.listIndex = undefined;
this.disableListButtons(false);
this.disableListButtons();
},
onDisconnect: function() {
this.onKeyChanged(this.cmbKey, {value: ""});
},
disableListButtons: function(disabled) {
if (disabled===undefined)
disabled = !this.list.getSelectedRec();
this.btnListDelete.setDisabled(disabled || this._state.DisabledControls);
this.btnListUp.setDisabled(disabled || this._state.DisabledControls);
this.btnListDown.setDisabled(disabled || this._state.DisabledControls);
disableListButtons: function() {
var rec = this.list.getSelectedRec(),
idx = rec ? this.list.store.indexOf(rec) : -1;
this.btnListDelete.setDisabled(idx<0 || this._state.DisabledControls);
this.btnListUp.setDisabled(idx<1 || this._state.DisabledControls);
this.btnListDown.setDisabled(idx<0 || idx>this.list.store.length-2 || this._state.DisabledControls);
},
onImagePositionChange: function (type, field, newValue, oldValue) {

View file

@ -2231,7 +2231,7 @@ define([
},
checkProtectedRange: function(callback, scope, args) {
var result = this.api.asc_isProtectedSheet() ? this.api.asc_checkProtectedRange() : false;
var result = this.api.asc_isProtectedSheet() && this.api.asc_checkLockedCells() ? this.api.asc_checkProtectedRange() : false;
if (result===null) {
this.onError(Asc.c_oAscError.ID.ChangeOnProtectedSheet, Asc.c_oAscError.Level.NoCritical);
return;
@ -2250,18 +2250,20 @@ define([
handler: function (result, value) {
if (result == 'ok') {
if (me.api) {
if (me.api.asc_checkActiveCellPassword(value.drmOptions.asc_getPassword())) {
callback && setTimeout(function() {
callback.apply(scope, args);
}, 1);
} else {
Common.UI.warning({
msg: me.errorWrongPassword,
callback: function() {
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
}
me.api.asc_checkActiveCellPassword(value.drmOptions.asc_getPassword(), function(res) {
if (res) {
callback && setTimeout(function() {
callback.apply(scope, args);
}, 1);
} else {
Common.UI.warning({
msg: me.errorWrongPassword,
callback: function() {
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
}
});
}
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);