Moving animation methods out of Util.js.

Animation methods get their own module, giving methods more sensible names:

 * `OpenLayers.Animation.requestFrame` (was `OpenLayers.Util.requestAnimationFrame`)
 * `OpenLayers.Animation.start` (was `OpenLayers.Util.startAnimation`)
 * `OpenLayers.Animation.stop` (was `OpenLayers.Util.stopAnimation`)
This commit is contained in:
tschaub
2012-01-03 09:43:50 -07:00
parent 3f6e0141a4
commit 3556af9cb2
10 changed files with 197 additions and 154 deletions
+7 -7
View File
@@ -1,10 +1,10 @@
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the Clear BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */
/**
* full text of the license.
*
* @requires OpenLayers/BaseTypes/Class.js
* @requires OpenLayers/Animation.js
*/
/**
@@ -53,7 +53,7 @@ OpenLayers.Tween = OpenLayers.Class({
/**
* Property: animationId
* {int} Loop id returned by OpenLayers.Util.startAnimation
* {int} Loop id returned by OpenLayers.Animation.start
*/
animationId: null,
@@ -91,12 +91,12 @@ OpenLayers.Tween = OpenLayers.Class({
this.duration = duration;
this.callbacks = options.callbacks;
this.time = 0;
OpenLayers.Util.stopAnimation(this.animationId);
OpenLayers.Animation.stop(this.animationId);
this.animationId = null;
if (this.callbacks && this.callbacks.start) {
this.callbacks.start.call(this, this.begin);
}
this.animationId = OpenLayers.Util.startAnimation(
this.animationId = OpenLayers.Animation.start(
OpenLayers.Function.bind(this.play, this)
);
},
@@ -114,7 +114,7 @@ OpenLayers.Tween = OpenLayers.Class({
if (this.callbacks && this.callbacks.done) {
this.callbacks.done.call(this, this.finish);
}
OpenLayers.Util.stopAnimation(this.animationId);
OpenLayers.Animation.stop(this.animationId);
this.animationId = null;
this.playing = false;
},