Improve terminal history behavior
This commit is contained in:
@@ -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,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>
|
||||
|
||||
@@ -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…" %>
|
||||
|
||||
Reference in New Issue
Block a user