Changeset 6387
- Timestamp:
- 02/27/08 08:57:13 (11 months ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Tween.js (modified) (4 diffs)
- trunk/openlayers/tests/test_Tween.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Map.js
r6329 r6387 319 319 */ 320 320 fallThrough: true, 321 322 /** 323 * Property: panTween 324 * {OpenLayers.Tween} Animated panning tween object, see panTo() 325 */ 326 panTween: null, 321 327 322 328 /** trunk/openlayers/lib/OpenLayers/Tween.js
r6131 r6387 59 59 interval: null, 60 60 61 /** 62 * Property: playing 63 * {Boolean} Tells if the easing is currently playing 64 */ 65 playing: false, 66 61 67 /** 62 68 * Constructor: OpenLayers.Tween … … 81 87 */ 82 88 start: function(begin, finish, duration, options) { 89 this.playing = true; 83 90 this.begin = begin; 84 91 this.finish = finish; … … 99 106 /** 100 107 * APIMethod: stop 101 * Stops the Tween, and calls the finish callback 108 * Stops the Tween, and calls the done callback 109 * Doesn't do anything if animation is already finished 102 110 */ 103 111 stop: function() { 112 if (!this.playing) { 113 return 114 } 115 104 116 if (this.callbacks && this.callbacks.done) { 105 117 this.callbacks.done.call(this, this.finish); … … 107 119 window.clearInterval(this.interval); 108 120 this.interval = null; 121 this.playing = false; 109 122 }, 110 123 trunk/openlayers/tests/test_Tween.html
r6131 r6387 47 47 48 48 function test_Tween_stop(t) { 49 t.plan( 1);49 t.plan(2); 50 50 51 51 var tween = new OpenLayers.Tween(); 52 52 tween.interval = window.setInterval(function() {}, 10); 53 tween.playing = true; 53 54 tween.stop(); 54 55 t.eq(tween.interval, null, "tween correctly stopped"); 56 57 tween.interval = window.setInterval(function() {}, 10); 58 tween.playing = false; 59 tween.stop(); 60 t.ok(tween.interval != null, "stop method doesn't do anything if tween isn't running"); 55 61 } 56 62
