Skip to content

Commit 22dbe81

Browse files
committed
collapse expanded book on header click; fix chapter button focus; clean up
1 parent d2e3219 commit 22dbe81

File tree

5 files changed

+224
-88
lines changed

5 files changed

+224
-88
lines changed

src/RealtimeServer/package-lock.json

Lines changed: 71 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SIL.XForge.Scripture/ClientApp/package-lock.json

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SIL.XForge.Scripture/ClientApp/src/app/shared/book-chapter-combined-chooser/book-chapter-combined-chooser.component.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,27 @@
2626
</span>
2727
</button>
2828

29-
<mat-menu
30-
#menu="matMenu"
31-
overlayPanelClass="book-chapter-combined-chooser-menu-overlay"
32-
class="book-chapter-combined-chooser-menu"
33-
>
29+
<mat-menu #menu="matMenu" [class]="overlayPanelClass">
3430
<div class="menu-content" (keydown)="handleMenuKeydown($event)">
3531
@if (expandedBook$ | async; as expandedBook) {
3632
@for (bookItem of filteredBooks$ | async; track bookItem; let bookIndex = $index) {
3733
<div
3834
class="book-wrapper"
39-
(mouseenter)="bookCursor$.next(bookIndex)"
35+
(mouseenter)="handleBookMouseEnter(bookIndex)"
4036
[class.selected]="expandedBook === bookItem"
37+
[class.cursor]="(bookCursor$ | async) === bookIndex"
4138
>
4239
<button #bookButton class="book" (click)="selectBook($event, bookItem)">
4340
{{ bookNames.get(bookItem) }}
4441
</button>
4542

4643
@if (expandedBook === bookItem) {
47-
<div class="chapter-display">
48-
@for (chapterItem of chapters[expandedBook] ?? []; track chapterItem; let chapterIndex = $index) {
44+
<div class="chapter-display" (click)="$event.stopPropagation()">
45+
@for (chapterItem of expandedBookChapters; track chapterItem; let chapterIndex = $index) {
4946
<button
5047
#chapterButton
5148
(click)="selectChapter(chapterItem)"
52-
(mouseenter)="chapterCursor$.next(chapterIndex)"
49+
(mouseenter)="handleChapterMouseEnter(bookIndex, chapterIndex)"
5350
class="chapter"
5451
[class.selected]="book === bookItem && chapter === chapterItem"
5552
[class.cursor]="

src/SIL.XForge.Scripture/ClientApp/src/app/shared/book-chapter-combined-chooser/book-chapter-combined-chooser.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ button {
8585
&.selected {
8686
background: $expandedBookBGColor;
8787

88-
&:hover {
88+
&.cursor {
8989
background: color.scale($expandedBookBGColor, $lightness: -4%);
9090
}
9191

0 commit comments

Comments
 (0)