Signature refactoring.

This commit is contained in:
Julia Radzhabova 2017-11-24 14:47:48 +03:00
parent 16c1af8a2b
commit 26aa0afc45
4 changed files with 11 additions and 9 deletions

View file

@ -119,14 +119,14 @@ define([
if ( this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
this.btnAddPwd = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'review-prev',
iconCls: 'btn-ic-protect',
caption: this.txtEncrypt
});
this.btnsAddPwd.push(this.btnAddPwd);
this.btnPwd = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-reviewview',
iconCls: 'btn-ic-protect',
caption: this.txtEncrypt,
menu: true,
visible: false
@ -135,7 +135,7 @@ define([
if (this.appConfig.canProtect) {
this.btnSignature = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-reviewview',
iconCls: 'btn-ic-signature',
caption: this.txtSignature,
menu: (this.appPrefix !== 'pe-')
});

View file

@ -275,6 +275,8 @@
.button-normal-icon(~'x-huge .btn-ic-docspell', 12, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-review', 13, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-reviewview', 30, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-protect', 35, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-signature', 36, @toolbar-big-icon-size);
.button-normal-icon(review-save, 14, @toolbar-big-icon-size);
.button-normal-icon(review-deny, 15, @toolbar-big-icon-size);
.button-normal-icon(review-next, 16, @toolbar-big-icon-size);

View file

@ -2268,7 +2268,7 @@ define([
menuImgPaste.setDisabled(islocked);
var signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.asc_getSignatureId() : undefined,
isInSign = (signGuid !== undefined);
isInSign = !!signGuid;
menuSignatureEditSign.setVisible(isInSign);
menuSignatureEditSetup.setVisible(isInSign);
menuEditSignSeparator.setVisible(isInSign);
@ -3345,7 +3345,7 @@ define([
}
},
onSignatureClick: function(menu, item) {
onSignatureClick: function(item) {
var datavalue = item.cmpEl.attr('data-value');
switch (item.value) {
case 0:
@ -3355,7 +3355,7 @@ define([
this.api.asc_ViewCertificate(datavalue); //certificate id
break;
case 2:
Common.NotificationCenter.trigger('protect:signature', 'visible', !this._isDisabled, datavalue);//guid, can edit settings for requested signature
Common.NotificationCenter.trigger('protect:signature', 'visible', this._isDisabled, datavalue);//guid, can edit settings for requested signature
break;
case 3:
this.api.asc_RemoveSignature(datavalue); //guid

View file

@ -1313,7 +1313,7 @@ define([
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && !isshapemenu && !ischartmenu);
documentHolder.mnuImgAdvanced.setDisabled(isObjLocked);
var isInSign = (signGuid !== undefined);
var isInSign = !!signGuid;
documentHolder.menuSignatureEditSign.setVisible(isInSign);
documentHolder.menuSignatureEditSetup.setVisible(isInSign);
documentHolder.menuEditSignSeparator.setVisible(isInSign);
@ -2487,7 +2487,7 @@ define([
_conf && view.paraBulletsPicker.selectRecord(_conf.rec, true);
},
onSignatureClick: function(menu, item) {
onSignatureClick: function(item) {
var datavalue = item.cmpEl.attr('data-value');
switch (item.value) {
case 0:
@ -2497,7 +2497,7 @@ define([
this.api.asc_ViewCertificate(datavalue); //certificate id
break;
case 2:
Common.NotificationCenter.trigger('protect:signature', 'visible', !this._isDisabled, datavalue);//guid, can edit settings for requested signature
Common.NotificationCenter.trigger('protect:signature', 'visible', this._isDisabled, datavalue);//guid, can edit settings for requested signature
break;
case 3:
this.api.asc_RemoveSignature(datavalue); //guid