bounds[ p ] = Math.round( clientRect[ p ] );
}
- return Popcorn.extend({}, bounds, { top: top, left: left } );
+ return Popcorn.extend({}, bounds, { top: top, left: left });
+ },
+
+ disable: function( instance, plugin ) {
+
+ var disabled = instance.data.disabled;
+
+ if ( disabled.indexOf( plugin ) === -1 ) {
+ disabled.push( plugin );
+ }
++
+ return instance;
+ },
+ enable: function( instance, plugin ) {
+
+ var disabled = instance.data.disabled,
+ index = disabled.indexOf( plugin );
+
+ if ( index > -1 ) {
+ disabled.splice( index, 1 );
+ }
++
+ return instance;
}
});
// Store this definition in an array sorted by times
var byStart = obj.data.trackEvents.byStart,
- byEnd = obj.data.trackEvents.byEnd;
-
- for ( var idx = byStart.length - 1; idx >= 0; idx-- ) {
+ byEnd = obj.data.trackEvents.byEnd,
+ idx;
+
+ for ( idx = byStart.length-1; idx >= 0; idx-- ) {
if ( track.start >= byStart[idx].start ) {
- byStart.splice( idx+1, 0, track );
+ byStart.splice( idx + 1, 0, track );
break;
}
}
-
- for ( var idx = byEnd.length - 1; idx >= 0; idx-- ) {
+
+ for ( idx = byEnd.length-1; idx >= 0; idx-- ) {
if ( track.start >= byEnd[idx].start ) {
- byEnd.splice( idx+1, 0, track );
+ byEnd.splice( idx + 1, 0, track );
break;
}
}