From 05f0f9b2c9b5850e40fe1b8b54ebc0aafe3e895e Mon Sep 17 00:00:00 2001 From: rwldrn Date: Fri, 24 Dec 2010 20:54:44 -0500 Subject: [PATCH] [#242] Ticket #241 Regression; Resolves 239, 241, 242 --- popcorn.js | 10 ++++++---- test/popcorn.unit.js | 23 ++++++++++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/popcorn.js b/popcorn.js index 5dc3ad0..d412651 100644 --- a/popcorn.js +++ b/popcorn.js @@ -660,11 +660,13 @@ // 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 ); } diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index b880bb3..f8e5c9c 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -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" + }) + }); -- 2.43.0