Update password changing.

This commit is contained in:
Julia Radzhabova 2017-11-15 11:40:36 +03:00
parent abdaa3ede6
commit 7d75359ff4

View file

@ -91,7 +91,7 @@ define([
this.api.asc_registerCallback('asc_onDocumentPassword', _.bind(this.onDocumentPassword, this)); this.api.asc_registerCallback('asc_onDocumentPassword', _.bind(this.onDocumentPassword, this));
if (this.appConfig.canProtect) { if (this.appConfig.canProtect) {
this.api.asc_registerCallback('asc_onSignatureClick', _.bind(this.onApiSignatureClick, this)); this.api.asc_registerCallback('asc_onSignatureClick', _.bind(this.onApiSignatureClick, this));
// this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onApiUpdateSignatures, this)); this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onApiUpdateSignatures, this));
} }
} }
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.SetDisabled, this)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.SetDisabled, this));
@ -115,15 +115,13 @@ define([
}, },
SetDisabled: function(state) { SetDisabled: function(state) {
// if (this.dlgChanges)
// this.dlgChanges.close();
this.view && this.view.SetDisabled(state); this.view && this.view.SetDisabled(state);
}, },
onPasswordClick: function(btn, opts){ onPasswordClick: function(btn, opts){
switch (opts) { switch (opts) {
case 'add': this.addPassword(); break; case 'add': this.addPassword(); break;
// case 'delete': this.deletePassword(); break; case 'delete': this.deletePassword(); break;
} }
Common.NotificationCenter.trigger('edit:complete', this.view); Common.NotificationCenter.trigger('edit:complete', this.view);
@ -156,7 +154,7 @@ define([
signType: 'invisible', signType: 'invisible',
handler: function(result, props) { handler: function(result, props) {
if (result == 'ok') { if (result == 'ok') {
me.api.setCurrentPassword(props); me.api.asc_setCurrentPassword(props);
} }
Common.NotificationCenter.trigger('edit:complete'); Common.NotificationCenter.trigger('edit:complete');
} }
@ -166,7 +164,7 @@ define([
}, },
deletePassword: function() { deletePassword: function() {
this.api.resetPassword(); this.api.asc_resetPassword();
}, },
addInvisibleSignature: function(btn) { addInvisibleSignature: function(btn) {
@ -233,6 +231,11 @@ define([
onApiSignatureClick: function(guid, width, height) { onApiSignatureClick: function(guid, width, height) {
this.signVisibleSignature(guid, width, height); this.signVisibleSignature(guid, width, height);
},
onApiUpdateSignatures: function(valid, requested){
this.SetDisabled(valid && valid.length>0);
} }
}, Common.Controllers.Protection || {})); }, Common.Controllers.Protection || {}));
}); });