mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
Enable special paste for unprotected regions
This commit is contained in:
@ -336,6 +336,13 @@ define([
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Paragraph || type === Asc.c_oAscTypeSelectElement.Table || type === Asc.c_oAscTypeSelectElement.Header) {
|
||||
var value = selectedElements[i].get_ObjectValue();
|
||||
value && (locked = locked || value.get_Locked());
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.UnProtectedRegion) { //(unprotected region)
|
||||
var value = selectedElements[i].get_ObjectValue();
|
||||
me.documentHolder._unprotectedRegion = {
|
||||
canEditText: value.get_canEditText(),
|
||||
canEditPara: value.get_canEditPara(),
|
||||
canInsObject: value.get_canInsObject()
|
||||
};
|
||||
}
|
||||
}
|
||||
if (in_equation) {
|
||||
|
||||
@ -861,7 +861,8 @@ define([], function () {
|
||||
dh.disableSpecialPaste = function() {
|
||||
var pasteContainer = this.documentHolder.cmpEl.find('#special-paste-container'),
|
||||
docProtection = this.documentHolder._docProtection,
|
||||
disabled = this._isDisabled || docProtection.isReadOnly || docProtection.isCommentsOnly;
|
||||
unprotectedRegion = this.documentHolder._unprotectedRegion,
|
||||
disabled = this._isDisabled || docProtection.isReadOnly && !unprotectedRegion.canInsObject || docProtection.isCommentsOnly && !unprotectedRegion.canInsObject;
|
||||
|
||||
if (pasteContainer.length>0 && pasteContainer.is(':visible')) {
|
||||
this.btnSpecialPaste.setDisabled(!!disabled);
|
||||
@ -2276,7 +2277,8 @@ define([], function () {
|
||||
dh.disableEquationBar = function() {
|
||||
var eqContainer = this.documentHolder.cmpEl.find('#equation-container'),
|
||||
docProtection = this.documentHolder._docProtection,
|
||||
disabled = this._isDisabled || this._state.equationLocked || docProtection.isReadOnly || docProtection.isFormsOnly || docProtection.isCommentsOnly;
|
||||
unprotectedRegion = this.documentHolder._unprotectedRegion,
|
||||
disabled = this._isDisabled || this._state.equationLocked || docProtection.isReadOnly && !unprotectedRegion.canInsObject || docProtection.isFormsOnly || docProtection.isCommentsOnly && !unprotectedRegion.canInsObject;
|
||||
|
||||
if (eqContainer.length>0 && eqContainer.is(':visible')) {
|
||||
this.equationBtns.forEach(function(item){
|
||||
|
||||
@ -73,6 +73,11 @@ define([
|
||||
isFormsOnly: false,
|
||||
isCommentsOnly: false
|
||||
};
|
||||
this._unprotectedRegion = {
|
||||
canEditText: false,
|
||||
canEditPara: false,
|
||||
canInsObject: false
|
||||
};
|
||||
this._langs = null;
|
||||
},
|
||||
|
||||
|
||||
@ -2134,7 +2134,7 @@ define([], function () {
|
||||
}
|
||||
|
||||
me.menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
|
||||
me.menuViewUndo.setDisabled(!me.api.asc_getCanUndo() || me._docProtection.isReadOnly);
|
||||
me.menuViewUndo.setDisabled(!me.api.asc_getCanUndo());
|
||||
me.menuViewCopySeparator.setVisible(isInSign);
|
||||
|
||||
var isRequested = (signProps) ? signProps.asc_getRequested() : false;
|
||||
|
||||
Reference in New Issue
Block a user