Improve terminal history behavior

This commit is contained in:
Jason Zimdars
2025-04-25 13:58:41 -05:00
parent 8201d1f7f7
commit 3468ccd41d
3 changed files with 10 additions and 3 deletions
@@ -6,4 +6,12 @@ export default class extends Controller {
toggle() {
this.element.classList.toggle(this.toggleClass)
}
add() {
this.element.classList.add(this.toggleClass)
}
remove() {
this.element.classList.remove(this.toggleClass)
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
<li class="min-width overflow-ellipsis">
<%= link_to event_action_sentence(event), collection_card_path(event.collection, event.eventable),
class: "terminal__link",
data: { turbo_frame: "_top" } %>
data: { action: "toggle-class#remove", turbo_frame: "_top" } %>
</li>
+1 -2
View File
@@ -12,8 +12,7 @@
autocapitalize: "off",
class: "terminal__input input fill-transparent unpad",
data: {
controller: "filter",
action: "keydown.up->toggle-class#toggle:prevent input->filter#filter keydown.esc->form#cancel:prevent"
action: "keydown.up->toggle-class#add:prevent keydown.down->toggle-class#remove:prevent keydown.esc->form#cancel:prevent"
},
id: "fizzy_do",
placeholder: "Search or type commands…" %>