]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/shelf-sort.js
Add notice to Page delete confirmation when in use as a template
[bookstack] / resources / js / components / shelf-sort.js
index 30eda5a21f7cf920fc99f254ac051b3e36b79408..d10470bd79a4ea7e19774bcb5eedc3c6e533ffad 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,7 +16,7 @@ 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',
@@ -78,6 +79,4 @@ class ShelfSort {
         this.input.value = shelfBookElems.map(elem => elem.getAttribute('data-id')).join(',');
     }
 
-}
-
-export default ShelfSort;
\ No newline at end of file
+}
\ No newline at end of file