|
| 1 | +<?xml version="1.0"?> |
| 2 | +<entry type="widget" name="jQuery.ui.mouse"> |
| 3 | + <title>Mouse Interaction</title> |
| 4 | + <desc>The base interaction layer.</desc> |
| 5 | + <longdesc> |
| 6 | + <p>Similar to <a href="/jQuery.Widget#jQuery-Widget2"><code>jQuery.Widget</code></a>, the mouse interaction is not intended to be used directly. It is purely a base layer for other widgets to inherit from. This page only documents what is added to <code>jQuery.Widget</code>, but it does include internal methods that are not intended to be overwritten. The intended public API is <a href="#method-_mouseStart"><code>_mouseStart()</code></a>, <a href="#method-_mouseDrag"><code>_mouseDrag()</code></a>, <a href="#method-_mouseStop"><code>_mouseStop()</code></a>, and <a href="#method-_mouseCapture"><code>_mouseCapture()</code></a>.</p> |
| 7 | + </longdesc> |
| 8 | + <options> |
| 9 | + <option name="cancel" type="Selector" default='"input,textarea,button,select,option"'> |
| 10 | + <desc>Prevents interactions from starting on specified elements.</desc> |
| 11 | + </option> |
| 12 | + <option name="delay" type="Number" default="0"> |
| 13 | + <desc>Time in milliseconds after mousedown until the interaction should start. This option can be used to prevent unwanted interactions when clicking on an element.</desc> |
| 14 | + </option> |
| 15 | + <option name="distance" type="Number" default="1"> |
| 16 | + <desc>Distance in pixels after mousedown the mouse must move before the interaction should start. This option can be used to prevent unwanted interactions when clicking on an element.</desc> |
| 17 | + </option> |
| 18 | + </options> |
| 19 | + <methods> |
| 20 | + <method name="_mouseInit"> |
| 21 | + <desc> |
| 22 | + Initializes the interaction event handlers. This must be called from the extending widget's <code>_create()</code> method. |
| 23 | + </desc> |
| 24 | + </method> |
| 25 | + <method name="_mouseDestroy"> |
| 26 | + <desc> |
| 27 | + Destroys the interaction event handlers. This must be called from the extending widget's <code>_destroy()</code> method. |
| 28 | + </desc> |
| 29 | + </method> |
| 30 | + <method name="_mouseDown"> |
| 31 | + <desc> |
| 32 | + Handles the beginning of an interaction. Verifies that the event is associated with the primary mouse button and ensures that the <a href="#option-delay"><code>delay</code></a> and <a href="#option-distance"><code>distance</code></a> options are met prior to starting the interaction. When the interaction is ready to start, invokes the <a href="#method-_mouseStart"><code>_mouseStart()</code></a> method for the extending widget to handle. |
| 33 | + </desc> |
| 34 | + </method> |
| 35 | + <method name="_mouseMove"> |
| 36 | + <desc> |
| 37 | + Handles each movement of the interaction. Invokes the <a href="#method-_mouseDrag"><code>mouseDrag()</code></a> method for the extending widget to handle. |
| 38 | + </desc> |
| 39 | + </method> |
| 40 | + <method name="_mouseUp"> |
| 41 | + <desc> |
| 42 | + Handles the end of the interaction. Invokes the <a href="#method-_mouseStop"><code>mouseStop()</code></a> method for the extending widget to handle. |
| 43 | + </desc> |
| 44 | + </method> |
| 45 | + <method name="_mouseDistanceMet" return="Boolean"> |
| 46 | + <desc> |
| 47 | + Determines whether the <a href="#option-distance"><code>distance</code></a> option has been met for the current interaction. |
| 48 | + </desc> |
| 49 | + </method> |
| 50 | + <method name="_mouseDelayMet" return="Boolean"> |
| 51 | + <desc> |
| 52 | + Determines whether the <a href="#option-delay"><code>delay</code></a> option has been met for the current interaction. |
| 53 | + </desc> |
| 54 | + </method> |
| 55 | + <method name="_mouseStart"> |
| 56 | + <desc> |
| 57 | + The extending widget should implement a <code>_mouseStart()</code> method to handle the beginning of an interaction. This method will receive the mouse event associated with the start of the interaction. |
| 58 | + </desc> |
| 59 | + </method> |
| 60 | + <method name="_mouseDrag"> |
| 61 | + <desc> |
| 62 | + The extending widget should implement a <code>_mouseDrag()</code> method to handle each movement of an interaction. This method will receive the mouse event associated with the movement. |
| 63 | + </desc> |
| 64 | + </method> |
| 65 | + <method name="_mouseStop"> |
| 66 | + <desc> |
| 67 | + The extending widget should implement a <code>_mouseStop()</code> method to handle the end of an interaction. This method will receive the mouse event associated with the end of the interaction. |
| 68 | + </desc> |
| 69 | + </method> |
| 70 | + <method name="_mouseCapture" return="Boolean"> |
| 71 | + <desc> |
| 72 | + Determines whether an interaction should start based on event target of the interaction. The default implementation always returns <code>true</code>. |
| 73 | + </desc> |
| 74 | + </method> |
| 75 | + </methods> |
| 76 | + <category slug="utilities"/> |
| 77 | + <category slug="interactions"/> |
| 78 | +</entry> |
0 commit comments