[DE] Refactoring sing dialog.

This commit is contained in:
Julia Radzhabova 2017-11-17 11:02:29 +03:00
parent 259d8852d9
commit 9fcd4314dd

View file

@ -248,8 +248,11 @@ define([
},500); },500);
}, },
hide: function() { close: function() {
Common.UI.Window.prototype.hide.apply(this, arguments); this.api.asc_unregisterCallback('on_signature_defaultcertificate_ret', this.binding.certificateChanged);
this.api.asc_unregisterCallback('on_signature_selectsertificate_ret', this.binding.certificateChanged);
Common.UI.Window.prototype.close.apply(this, arguments);
if (this.signObject) if (this.signObject)
this.signObject.destroy(); this.signObject.destroy();
@ -257,10 +260,11 @@ define([
afterRender: function () { afterRender: function () {
if (this.api) { if (this.api) {
this.api.asc_unregisterCallback('on_signature_defaultcertificate_ret', _.bind(this.onCertificateChanged, this)); this.binding = {
this.api.asc_registerCallback('on_signature_defaultcertificate_ret', _.bind(this.onCertificateChanged, this)); certificateChanged: _.bind(this.onCertificateChanged, this)
this.api.asc_unregisterCallback('on_signature_selectsertificate_ret', _.bind(this.onCertificateChanged, this)); };
this.api.asc_registerCallback('on_signature_selectsertificate_ret', _.bind(this.onCertificateChanged, this)); this.api.asc_registerCallback('on_signature_defaultcertificate_ret', this.binding.certificateChanged);
this.api.asc_registerCallback('on_signature_selectsertificate_ret', this.binding.certificateChanged);
this.api.asc_GetDefaultCertificate(); this.api.asc_GetDefaultCertificate();
} }