[329] Rebase hashchange tab code on core plugin developed for ticket 329.
[ckanext-ga-report.git] / ckanext / ga_report / templates / ga_report / site / index.html
blob:a/ckanext/ga_report/templates/ga_report/site/index.html -> blob:b/ckanext/ga_report/templates/ga_report/site/index.html
--- a/ckanext/ga_report/templates/ga_report/site/index.html
+++ b/ckanext/ga_report/templates/ga_report/site/index.html
@@ -41,36 +41,36 @@
 
     <div class="tabbable">
       <ul class="nav nav-tabs">
-        <li><a href="#totals" data-toggle="hashchange">Totals</a></li>
+        <li class="active"><a href="#totals" data-toggle="hashtab">Totals</a></li>
         <li class="dropdown">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Browsers
                 <b class="caret"></b></a>
             <ul class="dropdown-menu">
-                <li><a href="#browsers_names" data-toggle="hashchange">Browsers</a></li>
-                <li><a href="#browsers_versions" data-toggle="hashchange">Versions</a></li>
+                <li><a href="#browsers_names" data-toggle="hashtab">Browsers</a></li>
+                <li><a href="#browsers_versions" data-toggle="hashtab">Versions</a></li>
             </ul>
         </li>
         <li class="dropdown">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Operating Systems
                 <b class="caret"></b></a>
             <ul class="dropdown-menu">
-                <li><a href="#os" data-toggle="hashchange">Operating Systems</a></li>
-                <li><a href="#os_versions" data-toggle="hashchange">Versions</a></li>
+                <li><a href="#os" data-toggle="hashtab">Operating Systems</a></li>
+                <li><a href="#os_versions" data-toggle="hashtab">Versions</a></li>
             </ul>
         </li>
         <li class="dropdown">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Social
                 <b class="caret"></b></a>
             <ul class="dropdown-menu">
-                <li><a href="#social_networks" data-toggle="hashchange">All networks</a></li>
-                <li><a href="#social_referrals_totals" data-toggle="hashchange">Referral links</a></li>
+                <li><a href="#social_networks" data-toggle="hashtab">All networks</a></li>
+                <li><a href="#social_referrals_totals" data-toggle="hashtab">Referral links</a></li>
             </ul>
         </li>
-        <li><a href="#languages" data-toggle="hashchange">Languages</a></li>
-        <li><a href="#country" data-toggle="hashchange">Country</a></li>
+        <li><a href="#languages" data-toggle="hashtab">Languages</a></li>
+        <li><a href="#country" data-toggle="hashtab">Country</a></li>
       </ul>
       <div class="tab-content">
-        <div class="tab-pane" id="totals">
+        <div class="tab-pane active" id="totals">
              <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
                <label>Show stats table for:</label>
                ${month_selector(c.month, c.months, c.day)}
@@ -171,12 +171,6 @@
         CKAN.GA_Reports.bind_sparklines();
         CKAN.GA_Reports.bind_sidebar();
         CKAN.GA_Reports.bind_month_selector();
-        if (!window.location.hash) {
-          window.location.hash='totals';
-        }
-        else {
-          $(window).trigger('hashchange');
-        }
       });  
     </script>
   </py:def>