Skip to content

Polymer 1.X and 2.X element for drag-and-drop reordering of template items

License

Notifications You must be signed in to change notification settings

afloesch/sortable-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<sortable-list>

Polymer 1.X and 2.X custom element for drag-and-drop reorder of items.

For typical use just wrap your dom-repeat template item with a <sortable-list> element to get drag-and-drop reordering.

Relies on HTML 5 drag and drop browser support, so if you need to support older browsers which do not support HTML 5 drag and drop events then we suggest using a polyfill:

https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills

Install

bower install --save polymer-sortable-list

Usage

<sortable-list>
  <template is="dom-repeat" items='["item 1","item 2","item 3","item 4"]'>
    <div style="height:30px;cursor:pointer;">[[item]]</div>
  </template>
</sortable-list>

Viewing This Element

First, make sure you have the Polymer CLI installed. Then run polymer serve to serve this element locally.

$ polymer serve

Running Tests

$ polymer test

About

Polymer 1.X and 2.X element for drag-and-drop reordering of template items

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages