Browse Source

Fix rolling mode (#3663)

* pull from develop

* Fix rollingmode

* Change `this` to `me`
develop
Yotam Berkowitz 7 years ago
committed by GitHub
parent
commit
cd9562f76e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lib/timeline/Timeline.js

+ 3
- 3
lib/timeline/Timeline.js View File

@ -184,8 +184,8 @@ function Timeline (container, items, groups, options) {
//Single time autoscale/fit //Single time autoscale/fit
this.initialFitDone = false; this.initialFitDone = false;
this.on('changed', function (){ this.on('changed', function (){
if (me.itemsData == null || me.options.rollingMode) return;
if (!me.initialFitDone) {
if (me.itemsData == null) return;
if (!me.initialFitDone || !me.options.rollingMode) {
me.initialFitDone = true; me.initialFitDone = true;
if (me.options.start != undefined || me.options.end != undefined) { if (me.options.start != undefined || me.options.end != undefined) {
if (me.options.start == undefined || me.options.end == undefined) { if (me.options.start == undefined || me.options.end == undefined) {
@ -200,7 +200,7 @@ function Timeline (container, items, groups, options) {
} }
} }
if (!me.initialDrawDone && (me.initialRangeChangeDone || (!me.options.start && !me.options.end))) {
if (!me.initialDrawDone && (me.initialRangeChangeDone || (!me.options.start && !me.options.end) || me.options.rollingMode)) {
me.initialDrawDone = true; me.initialDrawDone = true;
me.dom.root.style.visibility = 'visible'; me.dom.root.style.visibility = 'visible';
me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen); me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen);

Loading…
Cancel
Save