Rename command controller => terminal controller and name the error class after terminal
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.has-error .terminal__input {
|
||||
.terminal--error .terminal__input {
|
||||
outline: 2px solid var(--color-negative);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
id: "commands_form",
|
||||
class: [ "flex align-center gap-half" ],
|
||||
data: {
|
||||
controller: "form commands",
|
||||
commands_error_class: "has-error",
|
||||
action: "turbo:submit-end->commands#focus keydown.meta+k@document->commands#focus turbo:submit-end->commands#handleSubmit"
|
||||
controller: "form",
|
||||
action: "turbo:submit-end->terminal#focus keydown.meta+k@document->terminal#focus turbo:submit-end->terminal#handleSubmit"
|
||||
} do %>
|
||||
<label class="terminal__label txt-nowrap" for="fizzy_do">Fizzy do ></label>
|
||||
|
||||
@@ -14,7 +13,7 @@
|
||||
autocapitalize: "off",
|
||||
class: "terminal__input input fill-transparent unpad",
|
||||
data: {
|
||||
commands_target: "input",
|
||||
terminal_target: "input",
|
||||
action: "keydown.up->toggle-class#add:prevent keydown.down->toggle-class#remove:prevent",
|
||||
turbo_permanent: true
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<%= tag.div class: "terminal full-width flex flex-column gap justify-end", data: {
|
||||
controller: "toggle-class",
|
||||
controller: "toggle-class terminal",
|
||||
terminal_error_class: "terminal--error",
|
||||
toggle_class_toggle_class: "terminal--open" } do %>
|
||||
<%= turbo_frame_tag :recent_commands, src: commands_path, refresh: "morph" %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user