Basically, I'd like to set the tolerance to fit when I drag the mouse from left to right, and touch when I go from right to left (akin to how CAD programs do it). I've looked around and, besides modifying the standard JQuery UI code to move at least 2 variables into a global scope (I'd prefer not to modify any of the standard files), there doesn't seem to be a method of doing this.
The current method I can see involves modifying the _mouseDrag function within selectable method, so as to move the x1 and x2 variables to a more global state to read them (they represent the start and end points of the selected area box horizontally).
To clarify:
- JQuery = 1.10.2 (Same as in the JQuery UI demo's)
- JQuery UI = 1.11.4 (Same as in the JQuery UI demo's) (Line 12059 is the start of
_mouseDrag) - Browser = Firefox on Ubuntu 14.04, everything up to date
You can check on
mousemoveif theclientXis less or more thanclientXon thestartevent and modify thetoleranceoption depending. Like this:http://jsfiddle.net/8fpr6c14/2/