Add hotkey to create a new card

This commit is contained in:
Andy Smith
2025-10-31 16:00:03 -05:00
parent b3ffbc6a79
commit 3ea5d4d632
2 changed files with 4 additions and 4 deletions
@@ -1,7 +1,7 @@
<div class="collection-tools card">
<%= button_to collection_cards_path(collection), method: :post, class: "btn btn--link", form: { data: { turbo_frame: "_top" } } do %>
<%= icon_tag "add" %>
<%= button_to collection_cards_path(collection), method: :post, class: "btn btn--link", form: { data: { turbo_frame: "_top" } }, data: { controller: "hotkey", action: "keydown.a@document->hotkey#click" } do %>
<span>Add a card</span>
<kbd>A</kbd>
<% end %>
<hr class="separator--horizontal full-width" aria-hidden="true">
@@ -1,8 +1,8 @@
<div class="header__actions header__actions--start">
<% if collection = user_filtering.single_collection_or_first %>
<%= button_to collection_cards_path(collection), method: :post, class: "btn btn--link btn--circle-mobile" do %>
<%= icon_tag "add" %>
<%= button_to collection_cards_path(collection), method: :post, class: "btn btn--link btn--circle-mobile", data: { controller: "hotkey", action: "keydown.a@document->hotkey#click" } do %>
<span>Add a card</span>
<kbd>A</kbd>
<% end %>
<% end %>
</div>