[162] Rearranging ga_reports graphs per ticket feedback. Series are sensibly ordered. Page is restructured.
[ckanext-ga-report.git] / ckanext / ga_report / public / scripts / ckanext_ga_reports.js
blob:a/ckanext/ga_report/public/scripts/ckanext_ga_reports.js -> blob:b/ckanext/ga_report/public/scripts/ckanext_ga_reports.js
--- a/ckanext/ga_report/public/scripts/ckanext_ga_reports.js
+++ b/ckanext/ga_report/public/scripts/ckanext_ga_reports.js
@@ -45,6 +45,7 @@
       graph: graph,
       legend: legend
     } );
+    myLegend.prepend('<div class="instructions">Click on a series below to isolate its graph:</div>');
     graph.render();
 };
 
@@ -94,6 +95,7 @@
       }
       legend_name = '#legend_'+legend_name;
       $('#graph-legend-container > *').hide();
+      $('#graph-legend-container .instructions').show();
       $(legend_name).show();
     }
   );
@@ -103,8 +105,8 @@
   var handler = function(e) { 
     var target = $(e.delegateTarget);
     var form = target.closest('form');
-    form.attr('action', form.attr('action')+window.location.hash);
-    form.submit();
+    var url = form.attr('action')+'?month='+target.val()+window.location.hash;
+    window.location = url;
   };
   var selectors = $('select[name="month"]');
   assert(selectors.length>0);