From a33773f1df7bd22a9020d5b98b703dbdfa88f431 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Sun, 8 May 2011 20:04:16 -0400 Subject: [PATCH] [#503] Fix getStyle calls to correctly call from this --- players/baseplayer/popcorn.baseplayer.js | 9 +++++---- players/baseplayer/popcorn.baseplayer.unit.js | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/players/baseplayer/popcorn.baseplayer.js b/players/baseplayer/popcorn.baseplayer.js index 30b7a2d..7c48fe5 100644 --- a/players/baseplayer/popcorn.baseplayer.js +++ b/players/baseplayer/popcorn.baseplayer.js @@ -137,10 +137,10 @@ var bounds = this._container.getBoundingClientRect(); - this.offsetWidth = this.width = container.getAttribute( "width" ) || getStyle( "width" ) || 0; - this.offsetHeight = this.height = container.getAttribute( "height" ) || getStyle( "height" ) || 0; + this.offsetWidth = this.width = this.getStyle( "width" ) || 0; + this.offsetHeight = this.height = this.getStyle( "height" ) || 0; this.offsetLeft = bounds.left; - this.offsetTop = bound.top; + this.offsetTop = bounds.top; this.offsetParent = this._container.offsetParent; return this._container; @@ -150,7 +150,8 @@ // Changing the type of this.resource requires this method to be overridden // Returns the computed value for CSS style 'prop' as computed by the browser getStyle: function( prop ) { - var elem = this._resource; + + var elem = this._resource || this._container; if ( elem.currentStyle ) { // IE syntax diff --git a/players/baseplayer/popcorn.baseplayer.unit.js b/players/baseplayer/popcorn.baseplayer.unit.js index 22bd004..d890f90 100644 --- a/players/baseplayer/popcorn.baseplayer.unit.js +++ b/players/baseplayer/popcorn.baseplayer.unit.js @@ -123,6 +123,7 @@ test( "Default Functionality", function () { player.play(); }); + test( "Extension and Method Overriding", function () { var expects = 4, count = 0, -- 2.43.0