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:
authormattab <matthieu.aubry@gmail.com>2015-10-05 01:26:02 +0300
committermattab <matthieu.aubry@gmail.com>2015-10-05 01:26:02 +0300
commitbb361c60fbc040c0492243ae5f09935f43ba0bf0 (patch)
tree3ed524d77830c21765de0b47d954db9527661c45 /plugins/Morpheus
parentac45d2e3dce4210c881b431c09e58f5f6c299728 (diff)
parent757566b40a31144eff1633b1537afbfd14b48858 (diff)
Merge branch 'master' into sparkline_css_fix
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;