From 26aa0afc45f6949088290df81bc925efaf5266b2 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 24 Nov 2017 14:47:48 +0300 Subject: [PATCH] Signature refactoring. --- apps/common/main/lib/view/Protection.js | 6 +++--- apps/common/main/resources/less/toolbar.less | 2 ++ apps/documenteditor/main/app/view/DocumentHolder.js | 6 +++--- .../spreadsheeteditor/main/app/controller/DocumentHolder.js | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js index 16f55fb20..b66853b11 100644 --- a/apps/common/main/lib/view/Protection.js +++ b/apps/common/main/lib/view/Protection.js @@ -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-') }); diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index 5b02b5eff..20e3e8246 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -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); diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 58081844e..4aefe7708 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -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 diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index bdb29ff9c..86453cbff 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -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