Skip to content

Commit b649738

Browse files
committed
Made book-sort changes based on screen reader testing
- Removed having sort items in tabbing order since they have no action. - Updated "show other books" list to add upon single selection since it was not clear how these were added (double press) without then seeing the add button, and even then the add button would be after the scroll list.
1 parent 022cbb9 commit b649738

File tree

7 files changed

+9
-28
lines changed

7 files changed

+9
-28
lines changed

resources/js/components/book-sort.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export class BookSort extends Component {
158158
this.setupSortPresets();
159159
this.setupMoveActions();
160160

161-
window.$events.listen('entity-select-confirm', this.bookSelect.bind(this));
161+
window.$events.listen('entity-select-change', this.bookSelect.bind(this));
162162
}
163163

164164
/**
@@ -260,7 +260,10 @@ export class BookSort extends Component {
260260
animation: 150,
261261
fallbackOnBody: true,
262262
swapThreshold: 0.65,
263-
onSort: this.updateMapInput.bind(this),
263+
onSort: () => {
264+
this.updateMapInput();
265+
this.updateMoveActionStateForAll();
266+
},
264267
dragClass: 'bg-white',
265268
ghostClass: 'primary-background-light',
266269
multiDrag: true,

resources/js/components/entity-selector.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export class EntitySelector extends Component {
1515
this.searchInput = this.$refs.search;
1616
this.loading = this.$refs.loading;
1717
this.resultsContainer = this.$refs.results;
18-
this.addButton = this.$refs.add;
1918

2019
this.search = '';
2120
this.lastClick = 0;
@@ -43,15 +42,6 @@ export class EntitySelector extends Component {
4342
if (event.keyCode === 13) event.preventDefault();
4443
});
4544

46-
if (this.addButton) {
47-
this.addButton.addEventListener('click', event => {
48-
if (this.selectedItemData) {
49-
this.confirmSelection(this.selectedItemData);
50-
this.unselectAll();
51-
}
52-
});
53-
}
54-
5545
// Keyboard navigation
5646
onChildEvent(this.$el, '[data-entity-type]', 'keydown', (e, el) => {
5747
if (e.ctrlKey && e.code === 'Enter') {

resources/sass/styles.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,6 @@ $loadingSize: 10px;
187187
height: 400px;
188188
padding-top: $-l;
189189
}
190-
.entity-selector-add button {
191-
margin: 0;
192-
display: block;
193-
width: 100%;
194-
border: 0;
195-
border-top: 1px solid #DDD;
196-
}
197190
&.compact {
198191
font-size: 10px;
199192
.entity-item-snippet {

resources/views/books/parts/sort-box-actions.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
title="{{ trans('entities.books_sort_move_down') }}">@icon('chevron-down')</button>
66
<div class="dropdown-container" component="dropdown">
77
<button refs="dropdown@toggle"
8+
type="button"
89
title="{{ trans('common.more') }}"
910
class="icon-button p-xs text-bigger"
1011
aria-haspopup="true"

resources/views/books/parts/sort-box.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
data-name="{{ $bookChild->name }}"
2727
data-created="{{ $bookChild->created_at->timestamp }}"
2828
data-updated="{{ $bookChild->updated_at->timestamp }}"
29-
tabindex="0">
29+
tabindex="-1">
3030
<div class="flex-container-row items-center">
3131
<div class="text-muted sort-list-handle px-s py-m">@icon('grip')</div>
3232
<div class="entity-list-item px-none no-hover">
@@ -47,7 +47,7 @@
4747
data-id="{{$page->id}}" data-type="page"
4848
data-name="{{ $page->name }}" data-created="{{ $page->created_at->timestamp }}"
4949
data-updated="{{ $page->updated_at->timestamp }}"
50-
tabindex="0">
50+
tabindex="-1">
5151
<div class="text-muted sort-list-handle px-s py-m">@icon('grip')</div>
5252
<div class="entity-list-item px-none no-hover">
5353
<span>@icon('page')</span>

resources/views/books/sort.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<h2 class="list-heading">{{ trans('entities.books_sort_show_other') }}</h2>
4242
<p class="text-muted">{{ trans('entities.books_sort_show_other_desc') }}</p>
4343

44-
@include('entities.selector', ['name' => 'books_list', 'selectorSize' => 'compact', 'entityTypes' => 'book', 'entityPermission' => 'update', 'showAdd' => true])
44+
@include('entities.selector', ['name' => 'books_list', 'selectorSize' => 'compact', 'entityTypes' => 'book', 'entityPermission' => 'update'])
4545

4646
</main>
4747
</div>

resources/views/entities/selector.blade.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,5 @@ class="entity-selector {{$selectorSize ?? ''}}"
88
<input refs="entity-selector@search" type="text" placeholder="{{ trans('common.search') }}" @if($autofocus ?? false) autofocus @endif>
99
<div class="text-center loading" refs="entity-selector@loading">@include('common.loading-icon')</div>
1010
<div refs="entity-selector@results"></div>
11-
@if($showAdd ?? false)
12-
<div class="entity-selector-add">
13-
<button refs="entity-selector@add" type="button"
14-
class="button outline">@icon('add'){{ trans('common.add') }}</button>
15-
</div>
16-
@endif
1711
</div>
1812
</div>

0 commit comments

Comments
 (0)