add a new 'playing' property to the Tween class so that a call to stop doesn't do anything if animation is already finished, r=ahocevar,crschmidt (Closes #1392)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6387 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -46,12 +46,18 @@
|
||||
}
|
||||
|
||||
function test_Tween_stop(t) {
|
||||
t.plan(1);
|
||||
t.plan(2);
|
||||
|
||||
var tween = new OpenLayers.Tween();
|
||||
tween.interval = window.setInterval(function() {}, 10);
|
||||
tween.playing = true;
|
||||
tween.stop();
|
||||
t.eq(tween.interval, null, "tween correctly stopped");
|
||||
|
||||
tween.interval = window.setInterval(function() {}, 10);
|
||||
tween.playing = false;
|
||||
tween.stop();
|
||||
t.ok(tween.interval != null, "stop method doesn't do anything if tween isn't running");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user