Skip to content

webraptor/ractive.sortable.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ractive.dragging.js

Native HTML5 Sortable ractive event definition.

Usage

After including ractive and ractive.sortable.js:

Template

<ul on-sortable="sortElement">
  {{#items:i}}
    <li>{{items[i]}}</li>
  {{/items}}</ul>

Code

Ractive Boilerplate

ractive = new Ractive({
  el: containerElement,
  template: templateElement,
  data: {
    items: [
      'One', 'Two', 'Three'
    ]
  }
});

Fires callback on sortable element drop event:

ractive.on('sortElement', function (event) {
  // do something in the callback. Element is already sorted anyways ...
  console.log(event);
});

Event Object

  • name Event name
  • type Event type
  • target Element being dragged or dropped.
  • original Native DOM Event

About

Native HTML5 Sortable ractive event definition.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published