mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-04 16:20:26 +00:00
Added multi-select to book-sort interface
As discussed in #2064 Closes #2067
This commit is contained in:
parent
4ef362143b
commit
898d0b5817
2 changed files with 9 additions and 1 deletions
resources
|
@ -1,4 +1,4 @@
|
||||||
import Sortable from "sortablejs";
|
import {Sortable, MultiDrag} from "sortablejs";
|
||||||
|
|
||||||
// Auto sort control
|
// Auto sort control
|
||||||
const sortOperations = {
|
const sortOperations = {
|
||||||
|
@ -43,6 +43,7 @@ class BookSort {
|
||||||
this.input = elem.querySelector('[book-sort-input]');
|
this.input = elem.querySelector('[book-sort-input]');
|
||||||
|
|
||||||
const initialSortBox = elem.querySelector('.sort-box');
|
const initialSortBox = elem.querySelector('.sort-box');
|
||||||
|
Sortable.mount(new MultiDrag());
|
||||||
this.setupBookSortable(initialSortBox);
|
this.setupBookSortable(initialSortBox);
|
||||||
this.setupSortPresets();
|
this.setupSortPresets();
|
||||||
|
|
||||||
|
@ -134,6 +135,9 @@ class BookSort {
|
||||||
onSort: this.updateMapInput.bind(this),
|
onSort: this.updateMapInput.bind(this),
|
||||||
dragClass: 'bg-white',
|
dragClass: 'bg-white',
|
||||||
ghostClass: 'primary-background-light',
|
ghostClass: 'primary-background-light',
|
||||||
|
multiDrag: true,
|
||||||
|
multiDragKey: 'CTRL',
|
||||||
|
selectedClass: 'sortable-selected',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,6 +275,10 @@
|
||||||
.entity-list-item > span:first-child {
|
.entity-list-item > span:first-child {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
}
|
}
|
||||||
|
.sortable-selected .entity-list-item, .sortable-selected .entity-list-item:hover {
|
||||||
|
outline: 1px dotted var(--color-primary);
|
||||||
|
background-color: var(--color-primary-light) !important;
|
||||||
|
}
|
||||||
.entity-list-item > div {
|
.entity-list-item > div {
|
||||||
display: block;
|
display: block;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue