Closed kevinpirola closed 9 years ago
Hello everybody, I found few minutes ago this bug in the timeline. The situation is this: I call the constructor, giving options directly in that method with:
var options = { width : "100%", height : "auto", minHeight:300, editable : false, zoomMin:7200000, scale:links.Timeline.StepDate.SCALE.HOUR, step:5, "min" : minData, // lower limit of visible range "max" : maxData, layout : "box", cluster: true, clusterMaxItems: 5, eventMargin:5 }; // Instantiate our timeline object. timeline = new links.Timeline(document.getElementById('mytimeline'), options);
This go to an error due to the fact that it can't set the property "scale" and "step".
The problem is that the constructor in timeline.js on line 116 is calling the
setOption()
method (line 237) prior to initialize the var "this.step" (line 249).
SetOption is indeed calling this.step.setScale, but this.step is still undefined.
Using the constructor alone and then settings the options directly with "setOption" is fine because this.step is now initialized.
The easy fix is to move line 237 after line 249 in timeline.js
bye!
Thanks, this should be fixed now in the master branch.
master
You are very welcome ;) Thanks to you for your work
Hello everybody, I found few minutes ago this bug in the timeline. The situation is this: I call the constructor, giving options directly in that method with:
This go to an error due to the fact that it can't set the property "scale" and "step".
The problem is that the constructor in timeline.js on line 116 is calling the
method (line 237) prior to initialize the var "this.step" (line 249).
SetOption is indeed calling this.step.setScale, but this.step is still undefined.
Using the constructor alone and then settings the options directly with "setOption" is fine because this.step is now initialized.
The easy fix is to move line 237 after line 249 in timeline.js
bye!