Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-10-02 10:28:13 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-10-02 10:28:13 +0300
commitd94331a2930ae7ec9beff4c114837fa706475f35 (patch)
tree1cf2d16ac5b4c3750a03b43ceb49741643f5c874 /plugins/Morpheus
parent0839f2e5e10dfb9908491f6bbf5bb3eaf9bb49b2 (diff)
refs #8811 disable save button when clicking on it
Diffstat (limited to 'plugins/Morpheus')
-rw-r--r--plugins/Morpheus/javascripts/ajaxHelper.js16
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;