Search and Top Navigation
#4584 closed bug (fixed)
Opened June 08, 2009 12:10PM UTC
Closed June 09, 2009 12:46AM UTC
$.ui.mouse.defaults never used
Reported by: | d.wachss | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8 |
Component: | ui.core | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
in ui.core.js , $.ui.mouse.defaults are defined but never used. The ui components that use $.ui.mouse (draggable, resizeable, etc.) define their own cancel, delay and distance options.
This is mostly just wasted bytes (the functions work with the options undefined), but is a problem for _mouseMove, which uses _mouseDistanceMet, which requires a non-zero value for distance. A widget that does not define distance will never trigger _mouseDrag.
Quick fix: eliminate $.ui.mouse.defaults entirely and make _mouseDistanceMet work with distance === undefined by reversing the condition:
return !(Math.max(...) < this.options.distance)
(any comparision with undefined returns false)
See jquery-ui-dev thread.