From cd19946d3e15222a191291fd27f8eff0a98de992 Mon Sep 17 00:00:00 2001 From: rwldrn Date: Thu, 6 Jan 2011 14:28:12 -0500 Subject: [PATCH] [#240] Popcorn.exec fires more than once per binding --- popcorn.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/popcorn.js b/popcorn.js index 9c8f11a..25315f6 100644 --- a/popcorn.js +++ b/popcorn.js @@ -295,26 +295,24 @@ !fn && ( fn = Popcorn.nop ); - var timer = 0, - self = this, + var self = this, callback = function execCallback( event ) { - if ( this.currentTime() >= time && !timer ) { + if ( this.currentTime() >= time && !callback.fired ) { - fn.call(self, event); + callback.fired = true; this.unlisten("execCallback"); - timer++; + fn.call(self, event); + } }; - + callback.fired = false; this.listen("timeupdate", callback); - - return this; }, removePlugin: function( name ) { -- 2.43.0