[DE forms] Disable edit buttons when no license (Bug 54910)
This commit is contained in:
parent
245275c571
commit
87415ea802
|
@ -673,6 +673,10 @@ define([
|
||||||
primary = 'buynow';
|
primary = 'buynow';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.canFillForms) {
|
||||||
|
this.disableEditing(true);
|
||||||
|
}
|
||||||
|
|
||||||
var value = Common.localStorage.getItem("de-license-warning");
|
var value = Common.localStorage.getItem("de-license-warning");
|
||||||
value = (value!==null) ? parseInt(value) : 0;
|
value = (value!==null) ? parseInt(value) : 0;
|
||||||
var now = (new Date).getTime();
|
var now = (new Date).getTime();
|
||||||
|
@ -1001,6 +1005,8 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onShowContentControlsActions: function(obj, x, y) {
|
onShowContentControlsActions: function(obj, x, y) {
|
||||||
|
if (this._isDisabled) return;
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
switch (obj.type) {
|
switch (obj.type) {
|
||||||
case Asc.c_oAscContentControlSpecificType.DateTime:
|
case Asc.c_oAscContentControlSpecificType.DateTime:
|
||||||
|
@ -1761,12 +1767,12 @@ define([
|
||||||
if (this.textMenu && !noobject) {
|
if (this.textMenu && !noobject) {
|
||||||
var cancopy = this.api.can_CopyCut(),
|
var cancopy = this.api.can_CopyCut(),
|
||||||
disabled = menu_props.paraProps && menu_props.paraProps.locked || menu_props.headerProps && menu_props.headerProps.locked ||
|
disabled = menu_props.paraProps && menu_props.paraProps.locked || menu_props.headerProps && menu_props.headerProps.locked ||
|
||||||
menu_props.imgProps && (menu_props.imgProps.locked || menu_props.imgProps.content_locked);
|
menu_props.imgProps && (menu_props.imgProps.locked || menu_props.imgProps.content_locked) || this._isDisabled;
|
||||||
this.textMenu.items[0].setDisabled(disabled || !this.api.asc_getCanUndo()); // undo
|
this.textMenu.items[0].setDisabled(disabled || !this.api.asc_getCanUndo()); // undo
|
||||||
this.textMenu.items[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo
|
this.textMenu.items[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo
|
||||||
|
|
||||||
this.textMenu.items[3].setDisabled(!cancopy); // copy
|
this.textMenu.items[3].setDisabled(disabled || !cancopy); // cut
|
||||||
this.textMenu.items[4].setDisabled(disabled || !cancopy); // cut
|
this.textMenu.items[4].setDisabled(!cancopy); // copy
|
||||||
this.textMenu.items[5].setDisabled(disabled) // paste;
|
this.textMenu.items[5].setDisabled(disabled) // paste;
|
||||||
|
|
||||||
this.showPopupMenu(this.textMenu, {}, event);
|
this.showPopupMenu(this.textMenu, {}, event);
|
||||||
|
@ -1800,6 +1806,11 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
disableEditing: function(state) {
|
||||||
|
this.view && this.view.btnClear && this.view.btnClear.setDisabled(state);
|
||||||
|
this._isDisabled = state;
|
||||||
|
},
|
||||||
|
|
||||||
errorDefaultMessage : 'Error code: %1',
|
errorDefaultMessage : 'Error code: %1',
|
||||||
unknownErrorText : 'Unknown error.',
|
unknownErrorText : 'Unknown error.',
|
||||||
convertationTimeoutText : 'Conversion timeout exceeded.',
|
convertationTimeoutText : 'Conversion timeout exceeded.',
|
||||||
|
|
Loading…
Reference in a new issue