]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/shelf-sort.js
Updated a whole load more js components
[bookstack] / resources / js / components / shelf-sort.js
index 07526716a932da86ca34bbec46f8e8cbfa4bf7b3..aa244086e88a173878c3dcf2c8aacd272ae4a1a6 100644 (file)
@@ -1,6 +1,7 @@
 import Sortable from "sortablejs";
+import {Component} from "./component";
 
-class ShelfSort {
+export class ShelfSort extends Component {
 
     setup() {
         this.elem = this.$el;
@@ -15,10 +16,11 @@ class ShelfSort {
 
     initSortable() {
         const scrollBoxes = this.elem.querySelectorAll('.scroll-box');
-        for (let scrollBox of scrollBoxes) {
+        for (const scrollBox of scrollBoxes) {
             new Sortable(scrollBox, {
                 group: 'shelf-books',
                 ghostClass: 'primary-background-light',
+                handle: '.handle',
                 animation: 150,
                 onSort: this.onChange.bind(this),
             });