Skip to content

Commit fd0635d

Browse files
committed
Draggable: Added option examples.
1 parent 17f6544 commit fd0635d

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

entries/draggable.xml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
</longdesc>
88
<added>1.0</added>
99
<options>
10-
<option name="addClasses" type="Boolean" default="true">
10+
<option name="addClasses" type="Boolean" default="true" example-value="false">
1111
<desc>If set to <code>false</code>, will prevent the <code>ui-draggable</code> class from being added. This may be desired as a performance optimization when calling <code>.draggable()</code> on hundreds of elements.</desc>
1212
</option>
13-
<option name="appendTo" default='"parent"'>
13+
<option name="appendTo" default='"parent"' example-value='"body"'>
1414
<desc>Which element the draggable helper should be appended to while dragging.</desc>
1515
<type name="jQuery">
1616
<desc>A jQuery object containing the element to append the helper to.</desc>
@@ -25,16 +25,16 @@
2525
<desc>The string <code>"parent"</code> will cause the helper to be a sibling of the draggable.</desc>
2626
</type>
2727
</option>
28-
<option name="axis" type="String" default="false">
28+
<option name="axis" type="String" default="false" example-value='"x"'>
2929
<desc>Constrains dragging to either the horizontal (x) or vertical (y) axis. Possible values: <code>"x"</code>, <code>"y"</code>.</desc>
3030
</option>
31-
<option name="cancel" type="Selector" default='"input,textarea,button,select,option"'>
31+
<option name="cancel" type="Selector" default='"input,textarea,button,select,option"' example-value='".title"'>
3232
<desc>Prevents dragging from starting on specified elements.</desc>
3333
</option>
34-
<option name="connectToSortable" type="Selector" default="false">
34+
<option name="connectToSortable" type="Selector" default="false" example-value='"#my-sortable"'>
3535
<desc>Allows the draggable to be dropped onto the specified sortables. If this option is used, a draggable can be dropped onto a sortable list and then becomes part of it. Note: The <a href="#option-helper"><code>helper</code></a> option must be set to <code>"clone"</code> in order to work flawlessly. Requires the <a href="/sortable/">jQuery UI Sortable plugin</a> to be included.</desc>
3636
</option>
37-
<option name="containment" default="false">
37+
<option name="containment" default="false" example-value='"parent"'>
3838
<desc>Constrains dragging to within the bounds of the specified element or region.</desc>
3939
<type name="Selector">
4040
<desc>The draggable element will be contained to the bounding box of the first element found by the selector. If no element is found, no containment will be set.</desc>
@@ -49,28 +49,28 @@
4949
<desc>An array defining a bounding box in the form <code>[ x1, y1, x2, y2 ]</code>.</desc>
5050
</type>
5151
</option>
52-
<option name="cursor" type="String" default='"auto"'>
52+
<option name="cursor" type="String" default='"auto"' example-value='"crosshair"'>
5353
<desc>The CSS cursor during the drag operation.</desc>
5454
</option>
55-
<option name="cursorAt" type="Object" default="false">
55+
<option name="cursorAt" type="Object" default="false" example-value="{ left: 5 }">
5656
<desc>Sets the offset of the dragging helper relative to the mouse cursor. Coordinates can be given as a hash using a combination of one or two keys: <code>{ top, left, right, bottom }</code>.</desc>
5757
</option>
58-
<option name="delay" type="Number" default="0">
58+
<option name="delay" type="Number" default="0" example-value="300">
5959
<desc>Time in milliseconds after mousedown until dragging should start. This option can be used to prevent unwanted drags when clicking on an element.</desc>
6060
</option>
6161
<xi:include href="../includes/widget-option-disabled.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
62-
<option name="distance" type="Number" default="1">
62+
<option name="distance" type="Number" default="1" example-value="10">
6363
<desc>Distance in pixels after mousedown the mouse must move before dragging should start. This option can be used to prevent unwanted drags when clicking on an element.</desc>
6464
</option>
65-
<option name="grid" type="Array" default="false">
65+
<option name="grid" type="Array" default="false" example-value="[ 50, 20 ]">
6666
<desc>Snaps the dragging helper to a grid, every x and y pixels. The array must be of the form <code>[ x, y ]</code>.</desc>
6767
</option>
68-
<option name="handle" default="false">
68+
<option name="handle" default="false" example-value='"h2"'>
6969
<desc>If specified, restricts dragging from starting unless the mousedown occurs on the specified element(s).</desc>
7070
<type name="Selector"/>
7171
<type name="Element"/>
7272
</option>
73-
<option name="helper" default='"original"'>
73+
<option name="helper" default='"original"' example-value='"clone"'>
7474
<desc>Allows for a helper element to be used for dragging display.</desc>
7575
<type name="String">
7676
<desc>If set to <code>"clone"</code>, then the element will be cloned and the clone will be dragged.</desc>
@@ -79,7 +79,7 @@
7979
<desc>A function that will return a DOMElement to use while dragging.</desc>
8080
</type>
8181
</option>
82-
<option name="iframeFix" default="false">
82+
<option name="iframeFix" default="false" example-value="true">
8383
<desc>Prevent iframes from capturing the mousemove events during a drag. Useful in combination with the <a href="#option-cursorAt"><code>cursorAt</code></a> option, or in any case where the mouse cursor may not be over the helper.</desc>
8484
<type name="Boolean">
8585
<desc>When set to <code>true</code>, transparent overlays will be placed over all iframes on the page.</desc>
@@ -88,16 +88,16 @@
8888
<desc>Any iframes matching the selector will be covered by transparent overlays.</desc>
8989
</type>
9090
</option>
91-
<option name="opacity" type="Number" default="false">
91+
<option name="opacity" type="Number" default="false" example-value="0.35">
9292
<desc>Opacity for the helper while being dragged.</desc>
9393
</option>
94-
<option name="refreshPositions" type="Boolean" default="false">
94+
<option name="refreshPositions" type="Boolean" default="false" example-value="true">
9595
<desc>
9696
If set to <code>true</code>, all droppable positions are calculated on every mousemove.
9797
<em>Caution: This solves issues on highly dynamic pages, but dramatically decreases performance.</em>
9898
</desc>
9999
</option>
100-
<option name="revert" default="false">
100+
<option name="revert" default="false" example-value="true">
101101
<desc>Whether the element should revert to its start position when dragging stops.</desc>
102102
<type name="Boolean">
103103
<desc>If set to <code>true</code> the element will always revert.</desc>
@@ -106,22 +106,22 @@
106106
<desc>If set to <code>"invalid"</code>, revert will only occur if the draggable has not been dropped on a droppable. For <code>"valid"</code>, it's the other way around.</desc>
107107
</type>
108108
</option>
109-
<option name="revertDuration" type="Number" default="500">
109+
<option name="revertDuration" type="Number" default="500" example-value="200">
110110
<desc>The duration of the revert animation, in milliseconds. Ignored if the <a href="#option-revert"><code>revert</code></a> option is <code>false</code>.</desc>
111111
</option>
112-
<option name="scope" type="String" default='"default"'>
112+
<option name="scope" type="String" default='"default"' example-value='"tasks"'>
113113
<desc>Used to group sets of draggable and droppable items, in addition to droppable's <a href="/droppable#option-accept"><code>accept</code></a> option. A draggable with the same <code>scope</code> value as a droppable will be accepted by the droppable.</desc>
114114
</option>
115-
<option name="scroll" type="Boolean" default="true">
115+
<option name="scroll" type="Boolean" default="true" example-value="false">
116116
<desc>If set to <code>true</code>, container auto-scrolls while dragging.</desc>
117117
</option>
118-
<option name="scrollSensitivity" type="Number" default="20">
118+
<option name="scrollSensitivity" type="Number" default="20" example-value="100">
119119
<desc>Distance in pixels from the edge of the viewport after which the viewport should scroll. Distance is relative to pointer, not the draggable. Ignored if the <a href="#option-scroll"><code>scroll</code></a> option is <code>false</code>.</desc>
120120
</option>
121-
<option name="scrollSpeed" type="Number" default="20">
121+
<option name="scrollSpeed" type="Number" default="20" example-value="100">
122122
<desc>The speed at which the window should scroll once the mouse pointer gets within the <a href="#option-scrollSensitivity"><code>scrollSensitivity</code></a> distance. Ignored if the <a href="#option-scroll"><code>scroll</code></a> option is <code>false</code>.</desc>
123123
</option>
124-
<option name="snap" default="false">
124+
<option name="snap" default="false" example-value="true">
125125
<desc>Whether the element should snap to other elements.</desc>
126126
<type name="Boolean">
127127
<desc>When set to <code>true</code>, the element will snap to all other draggable elements.</desc>
@@ -130,16 +130,16 @@
130130
<desc>A selector specifying which elements to snap to.</desc>
131131
</type>
132132
</option>
133-
<option name="snapMode" type="String" default='"both"'>
133+
<option name="snapMode" type="String" default='"both"' example-value='"inner"'>
134134
<desc>Determines which edges of snap elements the draggable will snap to. Ignored if the <a href="#option-snap"><code>snap</code></a> option is <code>false</code>. Possible values: <code>"inner"</code>, <code>"outer"</code>, <code>"both"</code>.</desc>
135135
</option>
136-
<option name="snapTolerance" type="Number" default="20">
136+
<option name="snapTolerance" type="Number" default="20" example-value="30">
137137
<desc>The distance in pixels from the snap element edges at which snapping should occur. Ignored if the <a href="#option-snap"><code>snap</code></a> option is <code>false</code>.</desc>
138138
</option>
139-
<option name="stack" type="Selector" default="false">
139+
<option name="stack" type="Selector" default="false" example-value='".products"'>
140140
<desc>Controls the z-index of the set of elements that match the selector, always brings the currently dragged item to the front. Very useful in things like window managers.</desc>
141141
</option>
142-
<option name="zIndex" type="Number" default="false">
142+
<option name="zIndex" type="Number" default="false" example-value="100">
143143
<desc>Z-index for the helper while being dragged.</desc>
144144
</option>
145145
</options>

0 commit comments

Comments
 (0)