]> git.0d.be Git - panikweb.git/commitdiff
move call to piwik after everything else has been done
authorFrédéric Péters <fpeters@0d.be>
Thu, 12 Sep 2013 09:14:30 +0000 (11:14 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 12 Sep 2013 09:14:30 +0000 (11:14 +0200)
panikweb_templates/static/js/specifics.js

index 64ba242cd18ee293a4e9675abef3dabc8e2c02ac..bfb607d9ff1ed35f0012fed69d514d96942b4bb5 100644 (file)
@@ -45,15 +45,6 @@ $(function() {
                var newTitle = html?html.match(/<title>(.*?)<\/title>/):'';
                if(newTitle){document.title = newTitle[1].trim().decodeHTML();}
 
-               if (typeof (Piwik) == 'object') {
-                       piwikTracker = Piwik.getAsyncTracker();
-                       if (typeof (piwikTracker.trackPageView) == 'function') {
-                               piwikTracker.setDocumentTitle(document.title);
-                               piwikTracker.setCustomUrl(window.location.href);
-                               piwikTracker.trackPageView();
-                       }
-               }
-
                /*
                Quite UGLY but needed for styling the whole body with ID
                Feel free to correct and find a better way
@@ -69,6 +60,16 @@ $(function() {
                $("#Changing").css({'min-height':$(window).height()});
                $.scrollTo('#Changing',1000,{offset:-$('#metaNav').height()+2});
                init();
+
+               if (typeof (Piwik) == 'object') {
+                       piwikTracker = Piwik.getAsyncTracker();
+                       if (typeof (piwikTracker.trackPageView) == 'function') {
+                               piwikTracker.setDocumentTitle(document.title);
+                               piwikTracker.setCustomUrl(window.location.href);
+                               piwikTracker.trackPageView();
+                       }
+               }
+
        };
 
        function afterLoadError(xhr, text, error) {