Native HTML5 Sortable ractive event definition.
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);
});
name
Event nametype
Event typetarget
Element being dragged or dropped.original
Native DOM Event