Browse Source

Timeline repaints when orientation is changed

css_transitions
jos 10 years ago
parent
commit
7a10407c27
2 changed files with 4 additions and 3 deletions
  1. +2
    -2
      src/timeline/Timeline.js
  2. +2
    -1
      src/timeline/component/TimeAxis.js

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

@ -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;
});

+ 2
- 1
src/timeline/component/TimeAxis.js View File

@ -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;
};
/**

Loading…
Cancel
Save