]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#239] Explicitly copy property setup.manifeset.options.target
authorrwldrn <waldron.rick@gmail.com>
Thu, 23 Dec 2010 21:35:27 +0000 (16:35 -0500)
committerrwldrn <waldron.rick@gmail.com>
Thu, 23 Dec 2010 21:44:05 +0000 (16:44 -0500)
popcorn.js
test/popcorn.unit.js

index 54434cd95e818060c21edbc098198c3dff410b3c..63714c9e77ff6f4d89daa1d0497242a0fa61af3d 100644 (file)
 
     Popcorn.forEach( src, function( copy ) {
       for ( var prop in copy ) {
-        if ( copy[prop] ) {
-          dest[prop] = copy[prop];
-        }
+        dest[prop] = copy[prop];
       }
     });
     return dest;      
       var size = 0;
 
       for ( var prop in obj  ) {
-        if ( obj[prop] ) {
-          size++;
-        }
+        size++;
       }
 
       return size;
         //  the events commence
         
         if ( "_setup" in setup && typeof setup._setup === "function" ) {
-          setup._setup.call( this, options );
+
+          setup._setup.call( this, Popcorn.extend( {}, options, {
+                                      target: setup.manifest.options.target || "" 
+                                   })
+                            );
         }
         
 
index a468e7f3cb75099ed4ab3f8b1b72133c8d067ca7..b880bb37d8e876fdd84b4d072af3b1ff1198efeb 100644 (file)
@@ -417,6 +417,21 @@ test("UI/Mouse", function () {
 module("Popcorn Plugin")
 test("Manifest", function () {
 
+
+
+  var p = Popcorn("#video"),                         
+      expects = 2, 
+      count   = 0;
+
+  function plus() {
+    if ( ++count === expects ) {
+      start(); 
+      // clean up added events after tests
+      p.removePlugin("footnote");
+    }
+  }
+  
+  stop( 10000 );
   Popcorn.plugin( "footnote" , (function(){
       
     return {
@@ -434,6 +449,10 @@ test("Manifest", function () {
           target  : 'text-container'
         }
       },    
+      _setup: function( options ) {
+         ok( options.target, "`options.target exists`" );
+         plus();
+      },
       start: function(event, options){
       },
 
@@ -446,13 +465,16 @@ test("Manifest", function () {
   })());
   
   
-  expect(1);
+  expect(expects);
   
   equal( Popcorn.sizeOf( Popcorn.manifest ), 1, "One manifest stored" );
+  plus();
   
   // add more tests
   
-  Popcorn("#video").removePlugin("footnote");
+  p.footnote({});
+  
+  
 });
 
 test("Update Timer", function () {