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

View File

@@ -1,7 +1,11 @@
/* 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
*/
OpenLayers.Kinetic = OpenLayers.Class({
@@ -59,7 +63,7 @@ OpenLayers.Kinetic = OpenLayers.Class({
* Begins the dragging.
*/
begin: function() {
OpenLayers.Util.stopAnimation(this.timerId);
OpenLayers.Animation.stop(this.timerId);
this.timerId = undefined;
this.points = [];
},
@@ -152,7 +156,7 @@ OpenLayers.Kinetic = OpenLayers.Class({
var v = -this.deceleration * t + v0;
if (v <= 0) {
OpenLayers.Util.stopAnimation(this.timerId);
OpenLayers.Animation.stop(this.timerId);
this.timerId = null;
args.end = true;
}
@@ -164,7 +168,7 @@ OpenLayers.Kinetic = OpenLayers.Class({
callback(args.x, args.y, args.end);
};
this.timerId = OpenLayers.Util.startAnimation(
this.timerId = OpenLayers.Animation.start(
OpenLayers.Function.bind(timerCallback, this)
);
},