BookStack/resources/js/components/sortable-list.js
Dan Brown 14b6cd1091
Started migration of attachment manager from vue
- Created new dropzone component.
- Added standard component event system using custom DOM events.
- Added tabs component.
- Added ajax-delete-row component.
2020-06-30 22:12:45 +01:00

22 lines
491 B
JavaScript

import Sortable from "sortablejs";
/**
* SortableList
* @extends {Component}
*/
class SortableList {
setup() {
this.container = this.$el;
this.handleSelector = this.$opts.handleSelector;
const sortable = new Sortable(this.container, {
handle: this.handleSelector,
animation: 150,
onSort: () => {
this.$emit('sort', {ids: sortable.toArray()});
}
});
}
}
export default SortableList;