GitHub - backbone-ui/reorder: Extending View with reordering capabilities using HTML5's Drag & Drop API

Update the order of dom elements on mouse drag, using HTML5's Drag n' Drop API

Install

Using bower:

bower install backbone.ui.reorder

Dependencies

Note that the plugin uses APP.View from Backbone APP if available, but falls back gracefully if you prefer using custom render logic.

Usage

var view = new Backbone.UI.Reorder({
		el : "#menu"
});
view.render();

Options

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"

Examples

Credits

Initiated by Makis Tracend ( @tracend )

Distributed through Makesites.org

Released under the MIT license