Skip to content

Commit 405029e

Browse files
committed
Allow turning off rollingMode via setOptions()
Turning it on via setOptions() already worked but not the opposite. fixes #939
1 parent 5317a5e commit 405029e

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

lib/timeline/Range.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,16 @@ export default class Range extends Component {
109109
];
110110
util.selectiveExtend(fields, this.options, options);
111111

112-
if (options.rollingMode && options.rollingMode.follow) {
113-
this.startRolling();
114-
}
115-
if (options.rollingMode && options.rollingMode.showButton && !this.rolling) {
116-
this.body.dom.rollingModeBtn.style.visibility = "visible";
112+
if (options.rollingMode) {
113+
if (options.rollingMode.follow) {
114+
this.startRolling();
115+
} else {
116+
this.stopRolling();
117+
}
118+
119+
if (options.rollingMode.showButton && !this.rolling) {
120+
this.body.dom.rollingModeBtn.style.visibility = "visible";
121+
}
117122
}
118123
if ('start' in options || 'end' in options) {
119124
// apply a new range. both start and end are optional

0 commit comments

Comments
 (0)