|
|
@ -88,7 +88,7 @@ Core.prototype._create = function (container) { |
|
|
|
this.dom.rightContainer.appendChild(this.dom.shadowTopRight); |
|
|
|
this.dom.rightContainer.appendChild(this.dom.shadowBottomRight); |
|
|
|
|
|
|
|
this.on('rangechange', this.redraw.bind(this)); |
|
|
|
this.on('rangechange', this._redraw.bind(this)); |
|
|
|
this.on('touch', this._onTouch.bind(this)); |
|
|
|
this.on('pinch', this._onPinch.bind(this)); |
|
|
|
this.on('dragstart', this._onDragStart.bind(this)); |
|
|
@ -101,13 +101,13 @@ Core.prototype._create = function (container) { |
|
|
|
if (!me._redrawTimer) { |
|
|
|
me._redrawTimer = setTimeout(function () { |
|
|
|
me._redrawTimer = null; |
|
|
|
me.redraw(); |
|
|
|
me._redraw(); |
|
|
|
}, 0) |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
// redraw immediately
|
|
|
|
me.redraw(); |
|
|
|
me._redraw(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -224,7 +224,7 @@ Core.prototype.setOptions = function (options) { |
|
|
|
} |
|
|
|
|
|
|
|
// redraw everything
|
|
|
|
this.redraw(); |
|
|
|
this._redraw(); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
@ -457,10 +457,18 @@ Core.prototype.getWindow = function() { |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* Force a redraw of the Core. Can be useful to manually redraw when |
|
|
|
* option autoResize=false |
|
|
|
* Force a redraw. Can be overridden by implementations of Core |
|
|
|
*/ |
|
|
|
Core.prototype.redraw = function() { |
|
|
|
this._redraw(); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* Redraw for internal use. Redraws all components. See also the public |
|
|
|
* method redraw. |
|
|
|
* @protected |
|
|
|
*/ |
|
|
|
Core.prototype._redraw = function() { |
|
|
|
var resized = false; |
|
|
|
var options = this.options; |
|
|
|
var props = this.props; |
|
|
@ -611,7 +619,7 @@ Core.prototype.redraw = function() { |
|
|
|
var MAX_REDRAWS = 3; // maximum number of consecutive redraws
|
|
|
|
if (this.redrawCount < MAX_REDRAWS) { |
|
|
|
this.redrawCount++; |
|
|
|
this.redraw(); |
|
|
|
this._redraw(); |
|
|
|
} |
|
|
|
else { |
|
|
|
console.log('WARNING: infinite loop in redraw?'); |
|
|
@ -819,7 +827,7 @@ Core.prototype._onDrag = function (event) { |
|
|
|
|
|
|
|
|
|
|
|
if (newScrollTop != oldScrollTop) { |
|
|
|
this.redraw(); // TODO: this causes two redraws when dragging, the other is triggered by rangechange already
|
|
|
|
this._redraw(); // TODO: this causes two redraws when dragging, the other is triggered by rangechange already
|
|
|
|
this.emit("verticalDrag"); |
|
|
|
} |
|
|
|
}; |
|
|
|