File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
examples/timeline/interaction Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1431,6 +1431,13 @@ <h2 id="Methods">Methods</h2>
1431
1431
</ td >
1432
1432
</ tr >
1433
1433
1434
+ < tr >
1435
+ < td > toggleRollingMode()</ td >
1436
+ < td > none</ td >
1437
+ < td > Toggle rollingMode.
1438
+ </ td >
1439
+ </ tr >
1440
+
1434
1441
< tr >
1435
1442
< td > zoomIn(percentage)</ td >
1436
1443
< td > none</ td >
Original file line number Diff line number Diff line change 38
38
< input type ="button " id ="zoomOut " value ="Zoom out "/>
39
39
< input type ="button " id ="moveLeft " value ="Move left "/>
40
40
< input type ="button " id ="moveRight " value ="Move right "/>
41
+ < input type ="button " id ="toggleRollingMode " value ="toggleRollingMode "/>
41
42
</ div >
42
43
</ div >
43
44
74
75
document . getElementById ( 'zoomOut' ) . onclick = function ( ) { timeline . zoomOut ( 0.2 ) ; } ;
75
76
document . getElementById ( 'moveLeft' ) . onclick = function ( ) { move ( 0.2 ) ; } ;
76
77
document . getElementById ( 'moveRight' ) . onclick = function ( ) { move ( - 0.2 ) ; } ;
78
+ document . getElementById ( 'toggleRollingMode' ) . onclick = function ( ) { timeline . toggleRollingMode ( ) } ;
79
+
77
80
78
81
</ script >
79
82
</ body >
Original file line number Diff line number Diff line change @@ -572,4 +572,20 @@ Timeline.prototype.getEventProperties = function (event) {
572
572
}
573
573
} ;
574
574
575
+ /**
576
+ * Toggle Timeline rolling mode
577
+ */
578
+
579
+ Timeline . prototype . toggleRollingMode = function ( ) {
580
+ if ( this . range . rolling ) {
581
+ this . range . stopRolling ( ) ;
582
+ } else {
583
+ if ( this . options . rollingMode == undefined ) {
584
+ this . setOptions ( options )
585
+ }
586
+ this . range . startRolling ( ) ;
587
+ }
588
+
589
+ }
590
+
575
591
module . exports = Timeline ;
You can’t perform that action at this time.
0 commit comments