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
path: root/js
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2016-11-07 22:38:21 +0300
committerThomas Steur <thomas.steur@gmail.com>2016-11-07 22:38:21 +0300
commit0bf5c4619f6ee4780a33e87f2f87d4938c785b67 (patch)
tree6dd81e56a8b6140f2b2f269c853dbbfc8d4e29d2 /js
parenta0dff4b82465638cb9160e22f09c000acd26e696 (diff)
added disableHeartBeatTimer feature
Diffstat (limited to 'js')
-rw-r--r--js/piwik.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/js/piwik.js b/js/piwik.js
index 59f0defc99..2691c1711e 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -6093,18 +6093,25 @@ if (typeof window.Piwik !== 'object') {
}
};
-/*<DEBUG>*/
/**
- * Clear heartbeat.
+ * Disable heartbeat if it was previously activated.
*/
this.disableHeartBeatTimer = function () {
heartBeatDown();
- configHeartBeatDelay = null;
+
+ if (configHeartBeatDelay || heartBeatSetUp) {
+ if (windowAlias.removeEventListener) {
+ windowAlias.removeEventListener('focus', heartBeatOnFocus, true);
+ windowAlias.removeEventListener('blur', heartBeatOnBlur, true);
+ } else if (windowAlias.detachEvent) {
+ windowAlias.detachEvent('onfocus', heartBeatOnFocus);
+ windowAlias.detachEvent('onblur', heartBeatOnBlur);
+ }
+ }
- window.removeEventListener('focus', heartBeatOnFocus);
- window.removeEventListener('blur', heartBeatOnBlur);
+ configHeartBeatDelay = null;
+ heartBeatSetUp = false;
};
-/*</DEBUG>*/
/**
* Frame buster