[ckan-changes] [okfn/ckan] ef3678: [xs] fix tracking js error

GitHub noreply at github.com
Wed May 2 10:41:09 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: ef3678d6a5bcb81550c07391a85f4b65f7909e24
      https://github.com/okfn/ckan/commit/ef3678d6a5bcb81550c07391a85f4b65f7909e24
  Author: Toby <toby.junk at gmail.com>
  Date:   2012-05-02 (Wed, 02 May 2012)

  Changed paths:
    M ckan/templates/layout_base.html

  Log Message:
  -----------
  [xs] fix tracking js error


diff --git a/ckan/templates/layout_base.html b/ckan/templates/layout_base.html
index 5b4595c..9d49ba1 100644
--- a/ckan/templates/layout_base.html
+++ b/ckan/templates/layout_base.html
@@ -274,7 +274,9 @@ <h3 class="widget-title">Meta</h3>
                  // Tracking
 				 var url = location.pathname;
 				 // remove any site root from url
-				 url = url.substring(CKAN.SITE_URL.length, url.length - 1);
+				 url = url.substring(CKAN.SITE_URL.length, url.length);
+				 // trim any trailing /
+				 url = url.replace(/\/*$/, '');
 				 $.ajax({url : CKAN.SITE_URL_NO_LOCALE + '/_tracking',
 						 type : 'POST',
 						 data : {url:url, type:'page'},


================================================================



More information about the ckan-changes mailing list