[DE] Lock signature settings in the right panel when cursor is in the locked object.

This commit is contained in:
Julia Radzhabova 2017-05-24 16:42:04 +03:00
parent 78ccd37302
commit efd79e497e
4 changed files with 17 additions and 9 deletions

View file

@ -78,8 +78,8 @@ define([
this._settings[Common.Utils.documentSettingsType.Shape] = {panelId: "id-shape-settings", panel: rightMenu.shapeSettings, btn: rightMenu.btnShape, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.TextArt] = {panelId: "id-textart-settings", panel: rightMenu.textartSettings, btn: rightMenu.btnTextArt, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.MailMerge] = {panelId: "id-mail-merge-settings", panel: rightMenu.mergeSettings, btn: rightMenu.btnMailMerge, hidden: 1, props: {}, locked: false};
this._settings[Common.Utils.documentSettingsType.Signature] = {panelId: "id-signature-settings", panel: rightMenu.signatureSettings, btn: rightMenu.btnSignature, hidden: 0, props: {}, locked: false};
this._settings[Common.Utils.documentSettingsType.MailMerge] = {panelId: "id-mail-merge-settings", panel: rightMenu.mergeSettings, btn: rightMenu.btnMailMerge, hidden: 1, props: {}, locked: false};
this._settings[Common.Utils.documentSettingsType.Signature] = {panelId: "id-signature-settings", panel: rightMenu.signatureSettings, btn: rightMenu.btnSignature, hidden: (rightMenu.signatureSettings) ? 0 : 1, props: {}, locked: false};
},
setApi: function(api) {
@ -156,6 +156,8 @@ define([
this._settings[settingsType].locked = value.get_Locked();
if (!this._settings[Common.Utils.documentSettingsType.MailMerge].locked) // lock MailMerge-InsertField, если хотя бы один объект locked
this._settings[Common.Utils.documentSettingsType.MailMerge].locked = value.get_Locked();
if (!this._settings[Common.Utils.documentSettingsType.Signature].locked) // lock Signature, если хотя бы один объект locked
this._settings[Common.Utils.documentSettingsType.Signature].locked = value.get_Locked();
}
if ( this._settings[Common.Utils.documentSettingsType.Header].locked ) { // если находимся в locked header/footer, то считаем, что все элементы в нем тоже недоступны
@ -206,7 +208,7 @@ define([
if (active !== undefined) {
this.rightmenu.SetActivePane(active, open);
if (active!=Common.Utils.documentSettingsType.MailMerge)
if (active!=Common.Utils.documentSettingsType.MailMerge && active!=Common.Utils.documentSettingsType.Signature)
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props);
else
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel);

View file

@ -244,7 +244,7 @@ define([
var me = this;
_.delay(function(){
me.inputPurpose.cmpEl.find('input').focus();
((me.signType == 'visible') ? me.inputName : me.inputPurpose).cmpEl.find('input').focus();
},500);
},

View file

@ -62,7 +62,7 @@ define([
}, options || {});
this.template = [
'<div class="box" style="height: 285px;">',
'<div class="box" style="height: 260px;">',
'<div class="input-row">',
'<label>' + this.textInfo + '</label>',
'</div>',

View file

@ -153,6 +153,8 @@ define([
if (!this._state.requestedSignatures || !this._state.validSignatures || !this._state.invalidSignatures) {
this.onUpdateSignatures(this.api.asc_getSignatures(), this.api.asc_getRequestSignatures());
}
this.disableControls(this._locked);
},
setLocked: function (locked) {
@ -235,7 +237,9 @@ define([
onSign: function(event) {
var me = this,
guid = $(event.currentTarget).attr('data-value');
target = $(event.currentTarget);
if (target.hasClass('disabled')) return;
if (_.isUndefined(me.fontStore)) {
me.fontStore = new Common.Collections.Fonts();
@ -256,7 +260,7 @@ define([
handler: function(dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId, guid, props.images[0], props.images[1]);
me.api.asc_Sign(props.certificateId, target.attr('data-value'), props.images[0], props.images[1]);
}
me.fireEvent('editcomplete', me);
}
@ -265,8 +269,10 @@ define([
},
onViewSignature: function(guid) {
var guid = $(event.currentTarget).attr('data-value');
this.api.asc_ViewCertificate(guid);
var target = $(event.currentTarget);
if (target.hasClass('disabled')) return;
this.api.asc_ViewCertificate(target.attr('data-value'));
},
strSignature: 'Signature',