Skip to content

Commit 532eea3

Browse files
committed
Merge branch 'master' of github.com:RubaXa/Sortable
2 parents 4bcb887 + 0c268ad commit 532eea3

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,44 @@ You can use any element for the list and its elements, not just `ul`/`li`. Here
3939
### Options
4040
```js
4141
var sortable = new Sortable(el, {
42-
group: "name", // or { name: "..", pull: [true, false, clone], put: [true, false, array] }
43-
sort: true, // sorting inside list
44-
store: null, // @see Store
45-
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
46-
handle: ".my-handle", // Drag handle selector within list items
47-
filter: ".ignor-elements", // Selectors that do not lead to dragging (String or Function)
48-
draggable: ".item", // Specifies which items inside the element should be sortable
49-
ghostClass: "sortable-ghost",
42+
group: "name", // or { name: "..", pull: [true, false, clone], put: [true, false, array] }
43+
sort: true, // sorting inside list
44+
store: null, // @see Store
45+
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
46+
handle: ".my-handle", // Drag handle selector within list items
47+
filter: ".ignore-elements", // Selectors that do not lead to dragging (String or Function)
48+
draggable: ".item", // Specifies which items inside the element should be sortable
49+
ghostClass: "sortable-ghost", // Class name for the drop placeholder - jsbin.com/luxero/3
5050
setData: function (dataTransfer, dragEl) {
5151
dataTransfer.setData('Text', dragEl.textContent);
5252
},
5353

54-
onStart: function (/**Event*/evt) { /* dragging */ },
55-
onEnd: function (/**Event*/evt) { /* dragging */ },
54+
onStart: function (/*Event*/evt) { /* dragging started*/ },
55+
onEnd: function (/*Event*/evt) { /* dragging ended */ },
5656

5757
// Element is dropped into the list from another list
58-
onAdd: function (/**Event*/evt){
58+
onAdd: function (/*Event*/evt){
5959
var itemEl = evt.item; // dragged HTMLElement
6060
itemEl.from; // previous list
6161
},
6262

6363
// Changed sorting within list
64-
onUpdate: function (/**Event*/evt){
64+
onUpdate: function (/*Event*/evt){
6565
var itemEl = evt.item; // dragged HTMLElement
6666
},
6767

6868
// Called by any change to the list (add / update / remove)
69-
onSort: function (/**Event*/evt){
69+
onSort: function (/*Event*/evt){
7070
var itemEl = evt.item; // dragged HTMLElement
7171
},
7272

7373
// Element is removed from the list into another list
74-
onRemove: function (/**Event*/evt){
74+
onRemove: function (/*Event*/evt){
7575
var itemEl = evt.item; // dragged HTMLElement
7676
},
7777

78-
onFilter: function (/**Event*/evt){
79-
var itemEl = evt.item; // HTMLElement on which was `mousedown|tapstart` event.
78+
onFilter: function (/*Event*/evt){
79+
var itemEl = evt.item; // HTMLElement receiving the `mousedown|tapstart` event.
8080
}
8181
});
8282
```
@@ -118,7 +118,7 @@ You can also define whether lists can give away, give and keep a copy (`clone`),
118118

119119
* name: `String` — group name
120120
* pull: `true|false|'clone'` — ability to move from the list. `clone` — copy the item, rather than move.
121-
* put: `true|false|["foo", "bar"]` — whether elements can be added from other lists, or an array of group names from which elements can be taken
121+
* put: `true|false|["foo", "bar"]` — whether elements can be added from other lists, or an array of group names from which elements can be taken. Demo: http://jsbin.com/naduvo/2/edit?html,js,output
122122

123123

124124
---
@@ -227,15 +227,15 @@ Sortable.create(el, {
227227
/**
228228
* Get the order of elements. Called once during initialization.
229229
* @param {Sortable} sortable
230-
* @retruns {Array}
230+
* @returns {Array}
231231
*/
232232
get: function (sortable) {
233233
var order = localStorage.getItem(sortable.options.group);
234234
return order ? order.split('|') : [];
235235
},
236236

237237
/**
238-
* Save the order of elements. Called every time at the drag end.
238+
* Save the order of elements. Called onEnd (when the item is dropped).
239239
* @param {Sortable} sortable
240240
*/
241241
set: function (sortable) {

0 commit comments

Comments
 (0)