Refactoring contex menu for signature.

This commit is contained in:
Julia Radzhabova 2017-11-23 14:29:41 +03:00
parent 7d1faecfb2
commit 084e254b42
3 changed files with 8 additions and 15 deletions

View file

@ -204,13 +204,6 @@ define([
win.show();
// var props = new AscCommon.asc_CSignatureLine();
// props.asc_setSigner1("s1");
// props.asc_setSigner2("s2");
// props.asc_setEmail('email');
// props.asc_setInstructions('instructions');
// props.asc_setShowDate(true);
if (guid)
win.setSettings(this.api.asc_getSignatureSetup(guid));
},

View file

@ -1822,8 +1822,8 @@ define([
this.viewModeMenu = new Common.UI.Menu({
initMenu: function (value) {
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties())),
signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.get_SignatureGuid() : undefined,
signProps = (signGuid) ? me.api.asc_getLineInfo(signGuid) : null,
signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.asc_getSignatureId() : undefined,
signProps = (signGuid) ? me.api.asc_getSignatureSetup(signGuid) : null,
isInSign = !!signProps && me._canProtect,
canComment = !isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled;
@ -1840,7 +1840,7 @@ define([
if (isInSign) {
menuSignatureViewSign.cmpEl.attr('data-value', signGuid); // sign
menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getCertificateId()); // view certificate
menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getId()); // view certificate
menuSignatureViewSetup.cmpEl.attr('data-value', signGuid); // view signature settings
menuSignatureRemove.cmpEl.attr('data-value', signGuid);
}
@ -2267,7 +2267,7 @@ define([
menuImgCut.setDisabled(islocked || !cancopy);
menuImgPaste.setDisabled(islocked);
var signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.get_SignatureGuid() : undefined,
var signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.asc_getSignatureId() : undefined,
isInSign = (signGuid !== undefined);
menuSignatureEditSign.setVisible(isInSign);
menuSignatureEditSetup.setVisible(isInSign);

View file

@ -1296,7 +1296,7 @@ define([
isimagemenu = true;
}
if (this.permissions.canProtect)
signGuid = elValue.get_SignatureGuid();
signGuid = elValue.asc_getSignatureId();
}
}
@ -1524,12 +1524,12 @@ define([
var selectedObjects = this.api.asc_getGraphicObjectProps();
for (var i = 0; i < selectedObjects.length; i++) {
if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
signGuid = selectedObjects[i].asc_getObjectValue().get_SignatureGuid();
signGuid = selectedObjects[i].asc_getObjectValue().asc_getSignatureId();
}
}
}
var signProps = (signGuid) ? this.api.asc_getLineInfo(signGuid) : null,
var signProps = (signGuid) ? this.api.asc_getSignatureSetup(signGuid) : null,
isInSign = !!signProps && this._canProtect,
canComment = iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled;
@ -1546,7 +1546,7 @@ define([
if (isInSign) {
documentHolder.menuSignatureViewSign.cmpEl.attr('data-value', signGuid); // sign
documentHolder.menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getCertificateId()); // view certificate
documentHolder.menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getId()); // view certificate
documentHolder.menuSignatureViewSetup.cmpEl.attr('data-value', signGuid); // view signature settings
documentHolder.menuSignatureRemove.cmpEl.attr('data-value', signGuid);
}