aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.slider.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-02-05 06:01:10 +0000
committerRichard Worth <rdworth@gmail.com>2009-02-05 06:01:10 +0000
commit5a6e2bdbb6838e56b2f6ea52c1ada3bdb5ac6f86 (patch)
tree361518a4782ba3378b8274524bc2540913b0a12c /ui/ui.slider.js
parent21b7b8ca42bacfa24d1bab1b6a26332b223d62fc (diff)
downloadjquery-ui-5a6e2bdbb6838e56b2f6ea52c1ada3bdb5ac6f86.tar.gz
jquery-ui-5a6e2bdbb6838e56b2f6ea52c1ada3bdb5ac6f86.zip
Fixed 4062 - slider: vertical slider handle jumps up when you click on it
Diffstat (limited to 'ui/ui.slider.js')
-rw-r--r--ui/ui.slider.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/ui.slider.js b/ui/ui.slider.js
index f96767b49..b1d4af1a1 100644
--- a/ui/ui.slider.js
+++ b/ui/ui.slider.js
@@ -214,7 +214,11 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
var mouseOverHandle = !$(event.target).parents().andSelf().is('.ui-slider-handle');
this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
left: event.pageX - offset.left + (parseInt(closestHandle.css('marginLeft'),10) || 0),
- top: event.pageY - offset.top + (parseInt(closestHandle.css('marginTop'),10) || 0)
+ top: event.pageY - offset.top
+ - (closestHandle.height() / 2)
+ - (parseInt(closestHandle.css('borderTopWidth'),10) || 0)
+ - (parseInt(closestHandle.css('borderBottomWidth'),10) || 0)
+ + (parseInt(closestHandle.css('marginTop'),10) || 0)
};
normValue = this._normValueFromMouse(position);