Browse Source

#142: + 'disabled' option

pull/154/head
RubaXa 10 years ago
parent
commit
cce17e8f86
  1. 1
      README.md
  2. 5
      Sortable.js

1
README.md

@ -41,6 +41,7 @@ You can use any element for the list and its elements, not just `ul`/`li`. Here
var sortable = new Sortable(el, {
group: "name", // or { name: "..", pull: [true, false, clone], put: [true, false, array] }
sort: true, // sorting inside list
disabled: false, // Disables the sortable if set to true.
store: null, // @see Store
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
handle: ".my-handle", // Drag handle selector within list items

5
Sortable.js

@ -81,6 +81,7 @@
var defaults = {
group: Math.random(),
sort: true,
disabled: false,
store: null,
handle: null,
draggable: el.children[0] && el.children[0].nodeName || (/[uo]l/i.test(el.nodeName) ? 'li' : '*'),
@ -163,8 +164,8 @@
filter = options.filter;
if (evt.type === 'mousedown' && evt.button !== 0) {
return; // only left button
if (evt.type === 'mousedown' && evt.button !== 0 || options.disabled) {
return; // only left button or enabled
}
// Check filter

Loading…
Cancel
Save