[DE] Bug 46552: select image for picture control

This commit is contained in:
Julia Radzhabova 2020-09-14 13:36:49 +03:00
parent 7a806b6610
commit 140af4963f

View file

@ -63,7 +63,9 @@ define([
_isComments = false, _isComments = false,
_menuPos = [], _menuPos = [],
_timer = 0, _timer = 0,
_canViewComments = true; _canViewComments = true,
_isRestrictedEdit = false,
_canFillForms = true;
return { return {
models: [], models: [],
@ -104,8 +106,14 @@ define([
setMode: function (mode) { setMode: function (mode) {
_isEdit = mode.isEdit; _isEdit = mode.isEdit;
_isRestrictedEdit = mode.isRestrictedEdit;
_canReview = mode.canReview; _canReview = mode.canReview;
_canViewComments = mode.canViewComments; _canViewComments = mode.canViewComments;
_canFillForms = mode.canFillForms;
if (_isEdit || _isRestrictedEdit && _canFillForms) {
this.api && this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
this.api && this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this));
}
}, },
// When our application is ready, lets get started // When our application is ready, lets get started
@ -451,6 +459,21 @@ define([
_isComments = false; _isComments = false;
}, },
onShowContentControlsActions: function(obj, x, y) {
var type = obj.type;
if (type==Asc.c_oAscContentControlSpecificType.Picture) {
if (obj.pr && obj.pr.get_Lock) {
var lock = obj.pr.get_Lock();
if (lock == Asc.c_oAscSdtLockType.SdtContentLocked || lock==Asc.c_oAscSdtLockType.ContentLocked)
return;
}
this.api.asc_addImage(obj);
}
},
onHideContentControlsActions: function() {
},
// Internal // Internal
_openLink: function(url) { _openLink: function(url) {