Skip to content

Extending View with reordering capabilities using HTML5's Drag & Drop API

Notifications You must be signed in to change notification settings

backbone-ui/reorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Backbone UI: Reorder

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

About

Extending View with reordering capabilities using HTML5's Drag & Drop API

Resources

Stars

Watchers

Forks

Packages

No packages published