From: Rick Waldron Date: Sun, 8 May 2011 23:45:05 +0000 (-0400) Subject: [#488] Replace getBoundingClientRect with pass through method to Popcorn.position() X-Git-Tag: v0.6~4^2~8^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=4fd6845b51c31b3d6cdbc419de78a2b05f59f246;p=popcorn-js.git [#488] Replace getBoundingClientRect with pass through method to Popcorn.position() --- diff --git a/players/baseplayer/popcorn.baseplayer.js b/players/baseplayer/popcorn.baseplayer.js index 30b7a2d..fe85e2d 100644 --- a/players/baseplayer/popcorn.baseplayer.js +++ b/players/baseplayer/popcorn.baseplayer.js @@ -63,36 +63,8 @@ // By default, assumes this.resource is a DOM Element // Changing the type of this.resource requires this method to be overridden getBoundingClientRect: function() { - var b, - self = this; - - if ( this._resource ) { - b = this._resource.getBoundingClientRect(); - - return { - bottom: Math.ceil( b.bottom ), - left: Math.ceil( b.left ), - right: Math.ceil( b.right ), - top: Math.ceil( b.top ), - - // These not guaranteed to be in there - width: b.width || ( b.right - b.left ), - height: b.height || ( b.bottom - b.top ) - }; - } else { - b = this._container.getBoundingClientRect(); - - // Update bottom, right for expected values once the container loads - return { - left: b.left, - top: b.top, - width: self.offsetWidth, - height: self.offsetHeight, - bottom: b.top + this.width, - right: b.top + this.height - }; - } - }, + return Popcorn.position( this._resource || this._container ); + }, // Add an event listener to the object addEventListener: function( evtName, fn ) {