prevent requests for null period of graph data, which causes lots of spam on console
authorForrest Voight <forrest@forre.st>
Fri, 19 Oct 2012 04:51:06 +0000 (00:51 -0400)
committerForrest Voight <forrest@forre.st>
Sat, 20 Oct 2012 20:00:09 +0000 (16:00 -0400)
web-static/graphs.html

index dc08915..de0bbf9 100644 (file)
                 .attr('href', function(period){ return "?" + period })
                 .attr("style", function(d, i) { return (i == 0 ? "" : "margin-left:.4em;") + "color:blue;text-decoration:underline;cursor:pointer" });
             period = window.location.search.substr(1);
-            if(period == "") {
+            if(period.length < 3) {
                 window.location.search = "Day";
+            } else {
+                d3.json('/web/currency_info', function(currency_info) {
+                    change_period(period, currency_info);
+                });
             }
-            d3.json('/web/currency_info', function(currency_info) {
-                change_period(period, currency_info);
-            });
         </script>
     </body>
 </html>