diff --git a/resources/js/components/book-sort.js b/resources/js/components/book-sort.js
index 3ffadf991..2722eb586 100644
--- a/resources/js/components/book-sort.js
+++ b/resources/js/components/book-sort.js
@@ -1,4 +1,4 @@
-import Sortable from "sortablejs";
+import Sortable, {MultiDrag} from "sortablejs";
import {Component} from "./component";
import {htmlToDom} from "../services/dom";
@@ -44,6 +44,8 @@ export class BookSort extends Component {
this.sortContainer = this.$refs.sortContainer;
this.input = this.$refs.input;
+ Sortable.mount(new MultiDrag());
+
const initialSortBox = this.container.querySelector('.sort-box');
this.setupBookSortable(initialSortBox);
this.setupSortPresets();
@@ -104,7 +106,7 @@ export class BookSort extends Component {
}
/**
- * Setup the given book container element to have sortable items.
+ * Set up the given book container element to have sortable items.
* @param {Element} bookContainer
*/
setupBookSortable(bookContainer) {
@@ -125,8 +127,8 @@ export class BookSort extends Component {
}
};
- for (let sortElem of sortElems) {
- new Sortable(sortElem, {
+ for (const sortElem of sortElems) {
+ Sortable.create(sortElem, {
group: sortElem.classList.contains('sort-list') ? bookGroupConfig : chapterGroupConfig,
animation: 150,
fallbackOnBody: true,
@@ -135,7 +137,7 @@ export class BookSort extends Component {
dragClass: 'bg-white',
ghostClass: 'primary-background-light',
multiDrag: true,
- multiDragKey: 'CTRL',
+ multiDragKey: 'Control',
selectedClass: 'sortable-selected',
});
}
diff --git a/resources/lang/en/entities.php b/resources/lang/en/entities.php
index fa2586f8d..5b019e848 100644
--- a/resources/lang/en/entities.php
+++ b/resources/lang/en/entities.php
@@ -141,6 +141,7 @@ return [
'books_search_this' => 'Search this book',
'books_navigation' => 'Book Navigation',
'books_sort' => 'Sort Book Contents',
+ 'books_sort_desc' => 'Move chapters and pages within a book to reorganise its contents. Other books can be added which allows easy moving of chapters and pages between books.',
'books_sort_named' => 'Sort Book :bookName',
'books_sort_name' => 'Sort by Name',
'books_sort_created' => 'Sort by Created Date',
@@ -148,6 +149,7 @@ return [
'books_sort_chapters_first' => 'Chapters First',
'books_sort_chapters_last' => 'Chapters Last',
'books_sort_show_other' => 'Show Other Books',
+ 'books_sort_show_other_desc' => 'Add other books here to include them in the sort operation, and allow easy cross-book reorganisation.',
'books_sort_save' => 'Save New Order',
'books_copy' => 'Copy Book',
'books_copy_success' => 'Book successfully copied',
diff --git a/resources/sass/_layout.scss b/resources/sass/_layout.scss
index 4c7de600b..3fc419046 100644
--- a/resources/sass/_layout.scss
+++ b/resources/sass/_layout.scss
@@ -268,6 +268,11 @@ body.flexbox {
}
}
+.sticky-top-m {
+ position: sticky;
+ top: $-m;
+}
+
/**
* Visibility
*/
diff --git a/resources/sass/_lists.scss b/resources/sass/_lists.scss
index 86a89051f..1ae801267 100644
--- a/resources/sass/_lists.scss
+++ b/resources/sass/_lists.scss
@@ -302,6 +302,20 @@
.sortable-page-list li.placeholder:before {
position: absolute;
}
+.sort-box summary {
+ list-style: none;
+ font-size: .9rem;
+ cursor: pointer;
+}
+.sort-box summary::-webkit-details-marker {
+ display: none;
+}
+details.sort-box summary .caret-container svg {
+ transition: transform ease-in-out 120ms;
+}
+details.sort-box[open] summary .caret-container svg {
+ transform: rotate(90deg);
+}
.activity-list-item {
padding: $-s 0;
diff --git a/resources/sass/styles.scss b/resources/sass/styles.scss
index 23959d1f8..398d16fac 100644
--- a/resources/sass/styles.scss
+++ b/resources/sass/styles.scss
@@ -199,6 +199,9 @@ $loadingSize: 10px;
.entity-item-snippet {
display: none;
}
+ h4 {
+ font-size: 14px;
+ }
}
}
diff --git a/resources/views/books/parts/sort-box.blade.php b/resources/views/books/parts/sort-box.blade.php
index ef9929e46..819f1e063 100644
--- a/resources/views/books/parts/sort-box.blade.php
+++ b/resources/views/books/parts/sort-box.blade.php
@@ -1,8 +1,15 @@
-
-
- @icon('book')
- {{ $book->name }}
-
+
+
+
+
+ @icon('caret-right')
+
+
+ @icon('book')
+ {{ $book->name }}
+
+
+
@@ -45,4 +52,4 @@
@endforeach
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/resources/views/books/sort.blade.php b/resources/views/books/sort.blade.php
index 077da101d..b778398a8 100644
--- a/resources/views/books/sort.blade.php
+++ b/resources/views/books/sort.blade.php
@@ -16,8 +16,10 @@