From f7e1f3ba9d00b24a4907515b69e8ec3691962c28 Mon Sep 17 00:00:00 2001 From: Dano Alexander Date: Wed, 3 Dec 2014 17:33:35 -0800 Subject: [PATCH 1/2] Fixed formatting at end of Readme Thanks for an excellent Js drag library. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dad6e99..a020218 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ var sortable = Sortable.create(el); ### Options ```js -var sortabel = new Sortable(el, { +var sortable = new Sortable(el, { group: "name", // or { name: "..", pull: [true, false, clone], put: [true, false, array] } sort: true, // sorting inside list store: null, // @see Store @@ -89,7 +89,7 @@ which is an area of every list element that allows it to be dragged around. ```js var sortable = new Sortable(el, { - handle: ".my-handle", + handle: ".my-handle" }); ``` @@ -272,7 +272,7 @@ Demo: http://jsbin.com/luxero/1/edit // Simple list Sortable.create(simpleList, { /* options */ }); - +``` --- From 4e172723149bb40a8cb6e180c7787941e8725504 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Wed, 3 Dec 2014 22:46:23 -0800 Subject: [PATCH 2/2] Mention list over divs; fix typos; update Bootstrap example --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a020218..6f93b09 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Demo: http://rubaxa.github.io/Sortable/ * Supports touch devices and [modern](http://caniuse.com/#search=drag) browsers * Can drag from one list to another or within the same list - * Animation moving items when sorting (css animation) + * CSS animation when moving items * Supports drag handles *and selectable text* (better than voidberg's html5sortable) * Built using native HTML5 drag and drop API * Supports [AngularJS](#ng) and and any CSS library, e.g. [Bootstrap](#bs) @@ -30,6 +30,8 @@ var el = document.getElementById('items'); var sortable = Sortable.create(el); ``` +You can use any element for the list and its elements, not just `ul`/`li`. Here is an [example with `div`s](http://jsbin.com/luxero/2/edit?html,js,output). + --- @@ -114,9 +116,9 @@ var sortable = new Sortable(el, { To drag elements from one list into another, both lists must have the same `group` value. You can also define whether lists can give away, give and keep a copy (`clone`), and receive elements. - * name:`string` — group name - * pull:`true|false|'clone'` — ability to move from the list. `clone` — cloning drag item when moving from the list. - * put:`true|false|["foo", "bar"]` — the possibility of adding an element from the other list, or an array of names groups, which can be taken. + * name: `String` — group name + * pull: `true|false|'clone'` — ability to move from the list. `clone` — copy the item, rather than move. + * 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 --- @@ -248,7 +250,7 @@ Sortable.create(el, { ### Bootstrap -Demo: http://jsbin.com/luxero/1/edit +Demo: http://jsbin.com/luxero/2/edit?html,js,output ```html @@ -297,7 +299,7 @@ Demo: http://jsbin.com/luxero/1/edit ## MIT LICENSE -Copyright 2013 Lebedev Konstantin +Copyright 2013-2014 Lebedev Konstantin http://rubaxa.github.io/Sortable/ Permission is hereby granted, free of charge, to any person obtaining