diff --git a/resources/js/components/book-sort.js b/resources/js/components/book-sort.js index e8ecd49a4..6e56e43a5 100644 --- a/resources/js/components/book-sort.js +++ b/resources/js/components/book-sort.js @@ -158,7 +158,7 @@ export class BookSort extends Component { this.setupSortPresets(); this.setupMoveActions(); - window.$events.listen('entity-select-confirm', this.bookSelect.bind(this)); + window.$events.listen('entity-select-change', this.bookSelect.bind(this)); } /** @@ -260,7 +260,10 @@ export class BookSort extends Component { animation: 150, fallbackOnBody: true, swapThreshold: 0.65, - onSort: this.updateMapInput.bind(this), + onSort: () => { + this.updateMapInput(); + this.updateMoveActionStateForAll(); + }, dragClass: 'bg-white', ghostClass: 'primary-background-light', multiDrag: true, diff --git a/resources/js/components/entity-selector.js b/resources/js/components/entity-selector.js index 1384b33a9..09d14b233 100644 --- a/resources/js/components/entity-selector.js +++ b/resources/js/components/entity-selector.js @@ -15,7 +15,6 @@ export class EntitySelector extends Component { this.searchInput = this.$refs.search; this.loading = this.$refs.loading; this.resultsContainer = this.$refs.results; - this.addButton = this.$refs.add; this.search = ''; this.lastClick = 0; @@ -43,15 +42,6 @@ export class EntitySelector extends Component { if (event.keyCode === 13) event.preventDefault(); }); - if (this.addButton) { - this.addButton.addEventListener('click', event => { - if (this.selectedItemData) { - this.confirmSelection(this.selectedItemData); - this.unselectAll(); - } - }); - } - // Keyboard navigation onChildEvent(this.$el, '[data-entity-type]', 'keydown', (e, el) => { if (e.ctrlKey && e.code === 'Enter') { diff --git a/resources/sass/styles.scss b/resources/sass/styles.scss index 398d16fac..e50a2f96a 100644 --- a/resources/sass/styles.scss +++ b/resources/sass/styles.scss @@ -187,13 +187,6 @@ $loadingSize: 10px; height: 400px; padding-top: $-l; } - .entity-selector-add button { - margin: 0; - display: block; - width: 100%; - border: 0; - border-top: 1px solid #DDD; - } &.compact { font-size: 10px; .entity-item-snippet { diff --git a/resources/views/books/parts/sort-box-actions.blade.php b/resources/views/books/parts/sort-box-actions.blade.php index cd5a59e15..3796ffafb 100644 --- a/resources/views/books/parts/sort-box-actions.blade.php +++ b/resources/views/books/parts/sort-box-actions.blade.php @@ -5,6 +5,7 @@ title="{{ trans('entities.books_sort_move_down') }}">@icon('chevron-down')