Update the order of dom elements on mouse drag, using HTML5's Drag n' Drop API
Using bower:
bower install backbone.ui.reorder
Note that the plugin uses APP.View from Backbone APP if available, but falls back gracefully if you prefer using custom render logic.
var view = new Backbone.UI.Reorder({
el : "#menu"
});
view.render();
A more detailed list of all the available options.
- item: selector for the individual item - default: "li"
- method: how to treat the drop event, either swaping or injecting the position of the element - default: "inject"
- hoverClass: the class assigner to the items the dragged element is hovering ver - default: "over"
- dataAttr: the key of the ordering attribute in the data model - default: "order"
Initiated by Makis Tracend ( @tracend )
Distributed through Makesites.org
Released under the MIT license