mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 22:31:41 +00:00
autofocus
This commit is contained in:
parent
55a3978a40
commit
6434d1c896
3 changed files with 5 additions and 2 deletions
|
@ -65,6 +65,7 @@ module ApplicationHelper
|
|||
{
|
||||
class: "form-control #{invalid(metadata.post, attribute)}",
|
||||
required: metadata.required,
|
||||
autofocus: (metadata.post.attributes.first == attribute),
|
||||
aria: {
|
||||
describedby: id_for_help(attribute),
|
||||
required: metadata.required
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
|
||||
= render("posts/attributes/#{type}",
|
||||
post: post, attribute: attribute,
|
||||
metadata: metadata, site: site)
|
||||
metadata: metadata, site: site,
|
||||
autofocus: (post.attributes.first == attribute))
|
||||
|
||||
-# Botones de guardado
|
||||
= render 'posts/submit', site: site, post: post
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
.form-check
|
||||
= check_box_tag "post[#{attribute}", metadata.value, metadata.value,
|
||||
class: "form-check-input #{invalid(post, attribute)}",
|
||||
aria: { describedby: id_for_help(attribute) }
|
||||
aria: { describedby: id_for_help(attribute) },
|
||||
autofocus: autofocus
|
||||
= label_tag "post_#{attribute}", post_label_t(attribute, post: post),
|
||||
class: 'form-check-label'
|
||||
|
||||
|
|
Loading…
Reference in a new issue