diff --git a/src/timeline/Timeline.js b/src/timeline/Timeline.js index 2ad131a5..187980b2 100644 --- a/src/timeline/Timeline.js +++ b/src/timeline/Timeline.js @@ -732,7 +732,8 @@ Timeline.prototype.getWindow = function setWindow() { * option autoResize=false */ Timeline.prototype.repaint = function repaint() { - var options = this.options, + var resized = false, + options = this.options, props = this.props, dom = this.dom, editable = options.editable.updateTime || options.editable.updateGroup; @@ -814,7 +815,6 @@ Timeline.prototype.repaint = function repaint() { dom.bottom.style.top = (props.top.height + props.centerContainer.height) + 'px'; // repaint all components - var resized = false; this.components.forEach(function (component) { resized = component.repaint() || resized; }); diff --git a/src/timeline/component/TimeAxis.js b/src/timeline/component/TimeAxis.js index b27fe8d3..e22e149b 100644 --- a/src/timeline/component/TimeAxis.js +++ b/src/timeline/component/TimeAxis.js @@ -73,6 +73,7 @@ TimeAxis.prototype.repaint = function () { // determine the correct parent DOM element (depending on option orientation) var parent = (options.orientation == 'top') ? this.timeline.dom.top : this.timeline.dom.bottom; + var parentChanged = (frame.parentNode !== parent); // update classname frame.className = 'timeaxis'; // TODO: add className from options if defined @@ -118,7 +119,7 @@ TimeAxis.prototype.repaint = function () { parent.appendChild(frame) } - return this._isResized(); + return this._isResized() || parentChanged; }; /**