]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#503] Fix getStyle calls to correctly call from this
authorRick Waldron <waldron.rick@gmail.com>
Mon, 9 May 2011 00:04:16 +0000 (20:04 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Mon, 9 May 2011 00:04:16 +0000 (20:04 -0400)
players/baseplayer/popcorn.baseplayer.js
players/baseplayer/popcorn.baseplayer.unit.js

index 30b7a2db548405b58bb7578428bfff6b08c64b00..7c48fe5e1ea9a2a8226bbec076016a0324c944ab 100644 (file)
       
       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;
     // 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
index 22bd004cec98d860a58f9f2f137a843dbdb560f5..d890f908969b6f31f8340158bff65e4ea3f821f1 100644 (file)
@@ -123,6 +123,7 @@ test( "Default Functionality", function () {
   player.play();
 });
 
+
 test( "Extension and Method Overriding", function () {
   var expects = 4,
       count = 0,