Skip to content

Commit

Permalink
getBoundingClientRect used whenever possible, not just for Trident.
Browse files Browse the repository at this point in the history
  • Loading branch information
3n committed May 15, 2009
1 parent 2bd57c9 commit aa3cef0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Element/Element.Dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ Element.implement({
},

getOffsets: function(){
if (Browser.Engine.trident){
if (this.getBoundingClientRect){
var bound = this.getBoundingClientRect(), html = this.getDocument().documentElement;
var isFixed = styleString(this, 'position') == 'fixed';
return {
x: bound.left + ((isFixed) ? 0 : html.scrollLeft) - html.clientLeft,
y: bound.top + ((isFixed) ? 0 : html.scrollTop) - html.clientTop
x: parseInt(bound.left, 10) + ((isFixed) ? 0 : html.scrollLeft) - html.clientLeft,
y: parseInt(bound.top, 10) + ((isFixed) ? 0 : html.scrollTop) - html.clientTop
};
}

Expand Down

0 comments on commit aa3cef0

Please sign in to comment.