]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#240] Popcorn.exec fires more than once per binding
authorrwldrn <waldron.rick@gmail.com>
Thu, 6 Jan 2011 19:28:12 +0000 (14:28 -0500)
committerrwldrn <waldron.rick@gmail.com>
Thu, 6 Jan 2011 19:28:12 +0000 (14:28 -0500)
popcorn.js

index 9c8f11a19c35603f1b6c2c3826307f6d0032bdb7..25315f62e4aa03488d553c2ec5628fe88c45f0b9 100644 (file)
       !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 ) {