diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-10-02 10:28:13 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-10-02 10:28:13 +0300 |
commit | d94331a2930ae7ec9beff4c114837fa706475f35 (patch) | |
tree | 1cf2d16ac5b4c3750a03b43ceb49741643f5c874 /plugins/Morpheus | |
parent | 0839f2e5e10dfb9908491f6bbf5bb3eaf9bb49b2 (diff) |
refs #8811 disable save button when clicking on it
Diffstat (limited to 'plugins/Morpheus')
-rw-r--r-- | plugins/Morpheus/javascripts/ajaxHelper.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/Morpheus/javascripts/ajaxHelper.js b/plugins/Morpheus/javascripts/ajaxHelper.js index 2413e63372..8050539192 100644 --- a/plugins/Morpheus/javascripts/ajaxHelper.js +++ b/plugins/Morpheus/javascripts/ajaxHelper.js @@ -100,6 +100,11 @@ function ajaxHelper() { this.errorCallback = this.defaultErrorCallback; /** + * Callback function to be executed on complete (after error or success) + */ + this.completeCallback = function () {}; + + /** * Params to be passed as GET params * @type {Object} * @see ajaxHelper._mixinDefaultGetParams @@ -245,6 +250,16 @@ function ajaxHelper() { }; /** + * Sets the complete callback which is called after an error or success callback. + * + * @param {function} callback Callback function + * @return {void} + */ + this.setCompleteCallback = function (callback) { + this.completeCallback = callback; + }; + + /** * error callback to use by default * * @param deferred @@ -359,6 +374,7 @@ function ajaxHelper() { async: this.async !== false, url: url, dataType: this.format || 'json', + complete: this.completeCallback, error: function () { --globalAjaxQueue.active; |