]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#242] Ticket #241 Regression; Resolves 239, 241, 242
authorrwldrn <waldron.rick@gmail.com>
Sat, 25 Dec 2010 01:54:44 +0000 (20:54 -0500)
committerrwldrn <waldron.rick@gmail.com>
Sat, 25 Dec 2010 01:54:44 +0000 (20:54 -0500)
popcorn.js
test/popcorn.unit.js

index 5dc3ad0aac43a1b05933e04bb898665864d35a0f..d4126518eb3a6dc0bd6f503d32fdb7a12dcb4ae6 100644 (file)
         //  the events commence
         
         if ( "_setup" in setup && typeof setup._setup === "function" ) {
+          
+          // Resolves 239, 241, 242
+          options.target || 
+            ( setup.manifest.options.target && 
+                ( options.target = setup.manifest.options.target ) );
 
-          setup._setup.call( this, options);
-          Popcorn.extend( {}, options, {
-                            target: setup.manifest.options.target || "" 
-                         });
+          setup._setup.call( this, options );
         }
         
 
index b880bb37d8e876fdd84b4d072af3b1ff1198efeb..f8e5c9cb09cf6ff938c8c9f5b23654ed90b8e1ae 100644 (file)
@@ -420,7 +420,8 @@ test("Manifest", function () {
 
 
   var p = Popcorn("#video"),                         
-      expects = 2, 
+      expects = 5,
+      run = 1,  
       count   = 0;
 
   function plus() {
@@ -450,8 +451,20 @@ test("Manifest", function () {
         }
       },    
       _setup: function( options ) {
-         ok( options.target, "`options.target exists`" );
-         plus();
+        ok( options.target, "`options.target exists`" );
+        plus();
+         
+        if ( run === 2 ) {
+          equals( options.target, 'custom-target', "Uses custom target if one is specified" );
+          plus();
+        }         
+
+        if ( run === 1 ) {
+          equals( options.target, 'text-container', "Uses manifest target by default" );
+          plus();
+          
+          run++; 
+        }
       },
       start: function(event, options){
       },
@@ -474,6 +487,10 @@ test("Manifest", function () {
   
   p.footnote({});
   
+  p.footnote({
+    target: "custom-target"
+  })
+  
   
 });