From: Rick Waldron Date: Mon, 9 May 2011 00:04:16 +0000 (-0400) Subject: [#503] Fix getStyle calls to correctly call from this X-Git-Tag: v0.6~30^2~1^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a33773f1df7bd22a9020d5b98b703dbdfa88f431;p=popcorn-js.git [#503] Fix getStyle calls to correctly call from this --- 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,