feat(web): 'a' keyboard shortcut toggles the annotations drawer
The drawer was the only top-bar tool without a keyboard shortcut, so the shortcuts & gestures help modal had to describe it as '📝 button'. Bind plain 'a' to toggleBookmarks(), following the same pattern as the existing t/s/b letter shortcuts. - reader.ts: new 'a' branch in handleKeydown, guarded against Ctrl/Cmd/Alt so Select All (a common reader action when selecting text to highlight/copy) is never intercepted; typing guard already protects note textareas, search box, and selects. Works in both the host page and book-content iframes since both keydown listeners route through handleKeydown. - reader.templ: help modal row now shows <kbd>a</kbd> like the other letter shortcuts; 📝 button tooltip gains '(a)' to match its siblings (b), (/), (s), (?). - reader_templ.go: regenerated.
This commit is contained in:
1 parent
f83b36167e
commit
31f939002f
3 files changed
+7
-4
No files matched your search
@@ -3535,6 +3535,9 @@ document.addEventListener("alpine:init", () => {
|
||||
if (k === "t") this.toggleTOC();
|
||||
else if (k === "s") this.toggleSettings();
|
||||
else if (k === "b") this.addBookmark();
|
||||
else if (k === "a") {
|
||||
if (!event.ctrlKey && !event.metaKey && !event.altKey) this.toggleBookmarks();
|
||||
}
|
||||
else if (k === "?") this.toggleHelp();
|
||||
else if (k === "/") {
|
||||
event.preventDefault();
|
||||
|
||||
Reference in new issue
Block a user