diff options
author | David Petersen <public@petersendidit.com> | 2013-02-11 20:04:28 -0600 |
---|---|---|
committer | David Petersen <public@petersendidit.com> | 2013-02-12 07:05:19 -0600 |
commit | c958b211db2632a02f26e14f57c0862c57870aee (patch) | |
tree | 8fa92c8ca020e0f4a57933cdac154a70d24b1180 /ui/jquery.ui.position.js | |
parent | ab408c9b82430e7a65a9269441cc0c0e2af95770 (diff) | |
download | jquery-ui-c958b211db2632a02f26e14f57c0862c57870aee.tar.gz jquery-ui-c958b211db2632a02f26e14f57c0862c57870aee.zip |
Position: Handle decimal percentage offsets. Fixes #9076: percentage offset does not support decimal
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r-- | ui/jquery.ui.position.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 0209b442c..81f1e4e8a 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -18,15 +18,15 @@ var cachedScrollbarWidth, round = Math.round, rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, - roffset = /[\+\-]\d+%?/, + roffset = /[\+\-]\d+(\.[\d]+)?%?/, rposition = /^\w+/, rpercent = /%$/, _position = $.fn.position; function getOffsets( offsets, width, height ) { return [ - parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), - parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) ]; } |