diff options
author | David Murdoch <musicisair@yahoo.com> | 2011-05-26 14:22:12 +0000 |
---|---|---|
committer | David Murdoch <musicisair@yahoo.com> | 2011-05-26 14:22:12 +0000 |
commit | 40c008872154965d7572cda7911d42857e9fc3a9 (patch) | |
tree | b19ebd254295b07e43874effe813f3c01476da27 /ui | |
parent | cde7cc0e6f5981d74390fa75c2519b935a4d6e0c (diff) | |
download | jquery-ui-40c008872154965d7572cda7911d42857e9fc3a9.tar.gz jquery-ui-40c008872154965d7572cda7911d42857e9fc3a9.zip |
Fix visual test in IE6 and move the new helper functions for getting scrollbar properties to $.position
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.position.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index e254ff9ff..5ebff5d16 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -17,8 +17,10 @@ var rhorizontal = /left|center|right/, rposition = /^\w+/, rpercent = /%$/, center = "center", - _position = $.fn.position, - getScrollbarWidth = function() { + _position = $.fn.position; + +$.position = { + scrollbarWidth : function() { var div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ), innerDiv = div.children()[0], w1, w2; @@ -36,13 +38,14 @@ var rhorizontal = /left|center|right/, return w1 - w2; }, - getScrollInfo = function( within ) { + getScrollInfo : function( within ) { var that = within[0], scrollHeight = within.height() < that.scrollHeight, scrollWidth = within.width() < that.scrollWidth, - scrollbarWidth = getScrollbarWidth(); + scrollbarWidth = $.position.scrollbarWidth(); return { height : scrollHeight ? scrollbarWidth : 0, width : scrollWidth ? scrollbarWidth : 0 }; - }; + } +}; $.fn.position = function( options ) { if ( !options || !options.of ) { @@ -145,7 +148,7 @@ $.fn.position = function( options ) { elemHeight = elem.outerHeight(), marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, - scrollInfo = getScrollInfo( within ), + scrollInfo = $.position.getScrollInfo( within ), collisionWidth = elemWidth + marginLeft + ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ) + scrollInfo.width, collisionHeight = elemHeight + marginTop + |