Skip to content

Commit 7644b0e

Browse files
committed
ESC is primary back hotkey, use helper in more places
1 parent e240897 commit 7644b0e

File tree

16 files changed

+16
-51
lines changed

16 files changed

+16
-51
lines changed

app/helpers/application_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def inline_svg(name)
1818

1919
def back_link_to(label, url, action, **options)
2020
link_to url, class: "btn btn--back", data: { controller: "hotkey", action: action }, **options do
21-
icon_tag("arrow-left") + tag.strong("Back to #{label}", class: "overflow-ellipsis") + tag.kbd("", class: "txt-x-small hide-on-touch").html_safe
21+
icon_tag("arrow-left") + tag.strong("Back to #{label}", class: "overflow-ellipsis") + tag.kbd("ESC", class: "txt-x-small hide-on-touch").html_safe
2222
end
2323
end
2424
end

app/helpers/boards_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module BoardsHelper
22
def link_back_to_board(board)
3-
back_link_to board.name, board, "keydown.left@document->hotkey#click click->turbo-navigation#backIfSamePath"
3+
back_link_to board.name, board, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click click->turbo-navigation#backIfSamePath"
44
end
55

66
def link_to_edit_board(board)

app/views/account/join_codes/edit.html.erb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
<% content_for :header do %>
44
<div class="header__actions header__actions--start">
5-
<%= link_to account_join_code_path, class: "btn btn--back borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
6-
<span class="overflow-ellipsis flex align-center">
7-
<%= icon_tag "arrow-left" %>
8-
<strong>Back to Invite link</strong>
9-
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
10-
</span>
11-
<% end %>
5+
<%= back_link_to "Invite link", account_join_code_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
126
</div>
137
<% end %>
148

app/views/account/join_codes/show.html.erb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
<% content_for :header do %>
44
<div class="header__actions header__actions--start">
5-
<%= link_to account_settings_path, class: "btn btn--back borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
6-
<span class="overflow-ellipsis flex align-center">
7-
<%= icon_tag "arrow-left" %>
8-
<strong>Back to Account Settings</strong>
9-
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
10-
</span>
11-
<% end %>
5+
<%= back_link_to "Account Settings", account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
126
</div>
137
<% end %>
148

app/views/events/day_timeline/columns/show.html.erb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
<% content_for :header do %>
44
<div class="header__actions header__actions--start">
5-
<%= link_to events_path, class: "btn btn--back", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
6-
<span class="overflow-ellipsis flex align-center">
7-
<%= icon_tag "arrow-left" %>
8-
<strong>Back to Actvity</strong>
9-
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
10-
</span>
11-
<% end %>
5+
<%= back_link_to "Actvity", root_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
126
</div>
137

148
<h1 class="header__title">

app/views/public/boards/columns/closeds/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<% content_for :header do %>
44
<div class="header__actions header__actions--start">
5-
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click" %>
5+
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
66
</div>
77

88
<h1 class="header__title divider divider--fade full-width">

app/views/public/boards/columns/not_nows/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<% content_for :header do %>
44
<div class="header__actions header__actions--start">
5-
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click" %>
5+
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
66
</div>
77

88
<h1 class="header__title divider divider--fade full-width">

app/views/public/boards/columns/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<% content_for :header do %>
44
<div class="header__actions header__actions--start">
5-
<%= back_link_to @column.board.name, published_board_url(@column.board), "keydown.left@document->hotkey#click" %>
5+
<%= back_link_to @column.board.name, published_board_url(@column.board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
66
</div>
77

88
<h1 class="header__title divider divider--fade full-width">

app/views/public/boards/columns/streams/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<% content_for :header do %>
44
<div class="header__actions header__actions--start">
5-
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click" %>
5+
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
66
</div>
77

88
<h1 class="header__title divider divider--fade full-width">

app/views/public/cards/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<% content_for :header do %>
1616
<div class="header__actions header__actions--start">
17-
<%= back_link_to @card.board.name, published_board_url(@card.board), "keydown.left@document->hotkey#click", style: "view-transistion-name: card-board-title;" %>
17+
<%= back_link_to @card.board.name, published_board_url(@card.board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click", style: "view-transistion-name: card-board-title;" %>
1818
</div>
1919
<% end %>
2020

0 commit comments

Comments
 (0)