mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-25 14:42:44 +03:00
- Created new dropzone component. - Added standard component event system using custom DOM events. - Added tabs component. - Added ajax-delete-row component.
22 lines
491 B
JavaScript
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; |