Browse Source

reverted to setTimeout in safari per #83

css_transitions
Alex de Mulder 10 years ago
parent
commit
e060e3ee94
1 changed files with 14 additions and 4 deletions
  1. +14
    -4
      src/graph/Graph.js

+ 14
- 4
src/graph/Graph.js View File

@ -1901,13 +1901,23 @@ if (typeof window !== 'undefined') {
/**
* Schedule a animation step with the refreshrate interval.
*
* @poram {Boolean} runCalculationStep
*/
Graph.prototype.start = function() {
if (this.moving || this.xIncrement != 0 || this.yIncrement != 0 || this.zoomIncrement != 0) {
if (!this.timer) {
this.timer = window.requestAnimationFrame(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
if (!this.timer) {
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('safari') != -1) {
if (ua.indexOf('chrome') <= -1) {
// safari
this.timer = window.setTimeout(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
}
else {
this.timer = window.requestAnimationFrame(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
}
}
else{
this.timer = window.requestAnimationFrame(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
}
}
}
else {

Loading…
Cancel
Save