Browse Source

Fix initial load when options start and end are not defined (#3664)

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

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

@ -184,7 +184,7 @@ 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 (this.itemsData == null || this.options.rollingMode) return;
if (me.itemsData == null || me.options.rollingMode) return;
if (!me.initialFitDone) { if (!me.initialFitDone) {
me.initialFitDone = true; me.initialFitDone = true;
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) {
if (!me.initialDrawDone && (me.initialRangeChangeDone || (!me.options.start && !me.options.end))) {
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