You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -37,27 +40,54 @@ Supported by [<img width="100px" src="https://user-images.githubusercontent.com/
37
40
38
41
### Articles
39
42
43
+
*[Dragging Multiple Items in Sortable](https://github.com/SortableJS/Sortable/wiki/Dragging-Multiple-Items-in-Sortable) (April 26, 2019)
40
44
*[Swap Thresholds and Direction](https://github.com/SortableJS/Sortable/wiki/Swap-Thresholds-and-Direction) (December 2, 2018)
41
45
*[Sortable v1.0 — New capabilities](https://github.com/SortableJS/Sortable/wiki/Sortable-v1.0-—-New-capabilities/) (December 22, 2014)
42
46
*[Sorting with the help of HTML5 Drag'n'Drop API](https://github.com/SortableJS/Sortable/wiki/Sorting-with-the-help-of-HTML5-Drag'n'Drop-API/) (December 23, 2013)
@@ -95,10 +125,12 @@ var sortable = new Sortable(el, {
95
125
filter:".ignore-elements", // Selectors that do not lead to dragging (String or Function)
96
126
preventOnFilter:true, // Call `event.preventDefault()` when triggered `filter`
97
127
draggable:".item", // Specifies which items inside the element should be draggable
128
+
129
+
dataIdAttr:'data-id',
130
+
98
131
ghostClass:"sortable-ghost", // Class name for the drop placeholder
99
132
chosenClass:"sortable-chosen", // Class name for the chosen item
100
133
dragClass:"sortable-drag", // Class name for the dragging item
101
-
dataIdAttr:'data-id',
102
134
103
135
swapThreshold:1, // Threshold of the swap zone
104
136
invertSwap:false, // Will always use inverted swap zone if set to true
@@ -111,12 +143,6 @@ var sortable = new Sortable(el, {
111
143
fallbackOnBody:false, // Appends the cloned DOM Element into the Document's Body
112
144
fallbackTolerance:0, // Specify in pixels how far the mouse should move before it's considered as a drag.
113
145
114
-
scroll:true, // or HTMLElement
115
-
scrollFn:function(offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling
116
-
scrollSensitivity:30, // px, how near the mouse must be to an edge to start scrolling.
117
-
scrollSpeed:10, // px
118
-
bubbleScroll:true, // apply autoscroll to all parent elements, allowing for easier movement
119
-
120
146
dragoverBubble:false,
121
147
removeCloneOnHide:true, // Remove the clone element when it is not showing, rather than just hiding it
122
148
emptyInsertThreshold:5, // px, distance mouse must be from empty sortable to insert drag element into it
@@ -231,7 +257,7 @@ Demo:
231
257
232
258
233
259
#### `sort` option
234
-
Sorting inside list.
260
+
Allow sorting inside list.
235
261
236
262
Demo: https://jsbin.com/jayedig/edit?js,output
237
263
@@ -257,9 +283,9 @@ Whether or not the delay should be applied only if the user is using touch (eg.
257
283
258
284
259
285
#### `swapThreshold` option
260
-
Percentage of the target that the swap zone will take up, as a float between `0` and `1`.
286
+
Percentage of the target that the swap zone will take up, as a float between `0` and `1`. This option has nothing to do with the `swap` option.
Set to `true` to set the swap zone to the sides of the target, for the effect of sorting "in between" items.
297
+
Set to `true` to set the swap zone to the sides of the target, for the effect of sorting "in between" items. This option has nothing to do with the `swap` option.
Percentage of the target that the inverted swap zone will take up, as a float between `0` and `1`. If not given, will default to `swapThreshold`.
308
+
Percentage of the target that the inverted swap zone will take up, as a float between `0` and `1`. If not given, will default to `swapThreshold`. This option has nothing to do with the `swap` option.
Direction that the Sortable should sort in. Can be set to `'vertical'`, `'horizontal'`, or a function, which will be called whenever a target is dragged over. Must return `'vertical'` or `'horizontal'`.
If set to `true`, the dragover event will bubble to parent sortables. Works on both fallback and native dragover event.
514
498
By default, it is false, but Sortable will only stop bubbling the event once the element has been inserted into a parent Sortable, or *can* be inserted into a parent Sortable, but isn't at that specific time (due to animation, etc).
0 commit comments