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:
pgiraud
2008-02-27 13:57:13 +00:00
parent 0fc0112e07
commit ffecbe0594
3 changed files with 27 additions and 2 deletions

View File

@@ -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>