diff options
author | diosmosis <benaka.moorthi@gmail.com> | 2013-02-26 02:04:50 +0400 |
---|---|---|
committer | diosmosis <benaka.moorthi@gmail.com> | 2013-02-26 02:04:50 +0400 |
commit | c6ac229c8e7d6cf032d50ae604f829933b11fd73 (patch) | |
tree | b42d93231c2abe6ccd5e6175a43bd72ced0f77d2 /js | |
parent | b3486f7d33f00f750e92ee94bda2ef6c4746ea83 (diff) |
Refs #1845, switch to async JS in other places and apply fixes to tracking code admin page & other pages.
Notes:
* Fix bug in Installation page that displays JS where newlines were not displayed and text would not be selected on click.
* Modify piwik.js to make sure setTrackerUrl is called before _paq is processed.
* Move _paq modifications in tracker code to global scope outside every anonymous function.
* Fix bug in rewritten site selector widget where selecting the same site didn't fire an event (necessary for some uses).
* Fix bug where change of site resulted in delay before site name in labels changed.
* Fix bug where site name was double encoded in tracking code admin page.
* Rewrite piwik_tag.tpl to use async tracking code.
Diffstat (limited to 'js')
-rw-r--r-- | js/piwik.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/js/piwik.js b/js/piwik.js index 310d9a510d..e1fe744a57 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -2882,9 +2882,20 @@ var Date.prototype.getTimeAlias = Date.prototype.getTime; asyncTracker = new Tracker(); + + // find the call to setTrackerUrl (if any) and call it first + for (i = 0; i < _paq.length; i++) { + if (_paq[i][0] == 'setTrackerUrl') { + apply(_paq[i]); + delete _paq[i]; + } + } + // apply the queue of actions for (i = 0; i < _paq.length; i++) { - apply(_paq[i]); + if (_paq[i]) { + apply(_paq[i]); + } } // replace initialization array with proxy object |