Browse Source

#379: + 'delay' description

pull/404/merge
RubaXa 10 years ago
parent
commit
08c31fc0bb
  1. 12
      README.md
  2. 4
      Sortable.js

12
README.md

@ -55,6 +55,7 @@ You can use any element for the list and its elements, not just `ul`/`li`. Here
var sortable = new Sortable(el, { var sortable = new Sortable(el, {
group: "name", // or { name: "...", pull: [true, false, clone], put: [true, false, array] } group: "name", // or { name: "...", pull: [true, false, clone], put: [true, false, array] }
sort: true, // sorting inside list sort: true, // sorting inside list
delay: 0, // time in milliseconds to define when the sorting should start
disabled: false, // Disables the sortable if set to true. disabled: false, // Disables the sortable if set to true.
store: null, // @see Store store: null, // @see Store
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
@ -140,7 +141,7 @@ You can also define whether lists can give away, give and keep a copy (`clone`),
#### `sort` option #### `sort` option
Sorting inside list Sorting inside list.
Demo: http://jsbin.com/xizeh/2/edit?html,js,output Demo: http://jsbin.com/xizeh/2/edit?html,js,output
@ -148,6 +149,15 @@ Demo: http://jsbin.com/xizeh/2/edit?html,js,output
--- ---
#### `delay` option
time in milliseconds to define when the sorting should start.
Demo: http://jsbin.com/xizeh/4/edit?html,js,output
---
#### `disabled` options #### `disabled` options
Disables the sortable if set to `true`. Disables the sortable if set to `true`.

4
Sortable.js

@ -1035,7 +1035,9 @@
/** @returns {HTMLElement|false} */ /** @returns {HTMLElement|false} */
function _ghostInBottom(el, evt) { function _ghostInBottom(el, evt) {
var lastEl = el.lastElementChild, rect = lastEl.getBoundingClientRect(); var lastEl = el.lastElementChild,
rect = lastEl.getBoundingClientRect();
return (evt.clientY - (rect.top + rect.height) > 5) && lastEl; // min delta return (evt.clientY - (rect.top + rect.height) > 5) && lastEl; // min delta
} }

Loading…
Cancel
Save