From 611736eca02f6e8c1b85bb3d840186789695c993 Mon Sep 17 00:00:00 2001 From: Phyks Date: Sun, 1 Jun 2014 01:10:17 +0200 Subject: [PATCH] Bugfix on resize when no points added --- timeline.js | 2 +- timeline.min.js | 6 +++--- timeline.min.js.map | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/timeline.js b/timeline.js index a47414d..132dbac 100644 --- a/timeline.js +++ b/timeline.js @@ -400,7 +400,7 @@ Timeline.prototype.draw = function() { } } - if(this.line !== 'none') { + if(this.line !== 'none' && filtered_points.length !== 0) { element = this.createElement('path', {'class': 'line', 'stroke': this.graphs[graph], 'stroke-width': 2, 'fill': 'none', 'd': 'M '+filtered_points[0].x+' '+filtered_points[0].y+' '+path}); if(this.line === 'dashed') { element.setAttribute('style', 'stroke-dasharray: '+this.dashed_style); diff --git a/timeline.min.js b/timeline.min.js index 26a456f..8b40e67 100644 --- a/timeline.min.js +++ b/timeline.min.js @@ -14,9 +14,9 @@ k);l.setAttribute("height",b);var d=g(Math.floor(e/Math.pow(10,Math.floor(Math.l b))}if("small"===this.grid||"both"===this.grid)k/=10,b/=10,l=this.holder.getElementById("smallGrid"),l.setAttribute("width",k),l.setAttribute("height",b),"small"===this.grid&&(e=g(Math.floor(e/Math.pow(10,Math.floor(Math.log(a-e)/Math.log(10))))*Math.pow(10,Math.floor(Math.log(a-e)/Math.log(10))),Math.floor(f/Math.pow(10,Math.floor(Math.log(c-f)/Math.log(10))))*Math.pow(10,Math.floor(Math.log(c-f)/Math.log(10)))),l.setAttribute("y",e.y),l.setAttribute("x",e.x)),l.querySelector("path").setAttribute("d", "M "+k+" 0 L 0 0 0 "+b);!0===this.x_axis&&(y=g(0,0).y,this.axis.setAttribute("y1",y),this.axis.setAttribute("y2",y));return g}; Timeline.prototype.draw=function(){for(var g=this.scale(this.raw_points),e=[],f,a,c,k=this,b=0;be.length);)d++;for(var h=f+1;he.length);)d++;for(var h=f+1;h