r2151 - trunk/ui

r2151 - trunk/ui


Author: rdworth
Date: Sat Feb 28 12:45:05 2009
New Revision: 2151
Modified:
trunk/ui/ui.slider.js
Log:
slider: use handle width / 2 instead of marginLeft to find offset of
mousedown relative to center of handle (fixes #4063 - slider: horizontal
slider handle jumps up when you click on it IE6)
Modified: trunk/ui/ui.slider.js
==============================================================================
--- trunk/ui/ui.slider.js    (original)
+++ trunk/ui/ui.slider.js    Sat Feb 28 12:45:05 2009
@@ -222,7 +222,7 @@
        var offset = closestHandle.offset();
        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),
+            left: event.pageX - offset.left - (closestHandle.width() / 2),
            top: event.pageY - offset.top
                - (closestHandle.height() / 2)
                - (parseInt(closestHandle.css('borderTopWidth'),10) || 0)