mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 15:36:22 +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)}",
|
class: "form-control #{invalid(metadata.post, attribute)}",
|
||||||
required: metadata.required,
|
required: metadata.required,
|
||||||
|
autofocus: (metadata.post.attributes.first == attribute),
|
||||||
aria: {
|
aria: {
|
||||||
describedby: id_for_help(attribute),
|
describedby: id_for_help(attribute),
|
||||||
required: metadata.required
|
required: metadata.required
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
|
|
||||||
= render("posts/attributes/#{type}",
|
= render("posts/attributes/#{type}",
|
||||||
post: post, attribute: attribute,
|
post: post, attribute: attribute,
|
||||||
metadata: metadata, site: site)
|
metadata: metadata, site: site,
|
||||||
|
autofocus: (post.attributes.first == attribute))
|
||||||
|
|
||||||
-# Botones de guardado
|
-# Botones de guardado
|
||||||
= render 'posts/submit', site: site, post: post
|
= render 'posts/submit', site: site, post: post
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
.form-check
|
.form-check
|
||||||
= check_box_tag "post[#{attribute}", metadata.value, metadata.value,
|
= check_box_tag "post[#{attribute}", metadata.value, metadata.value,
|
||||||
class: "form-check-input #{invalid(post, attribute)}",
|
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),
|
= label_tag "post_#{attribute}", post_label_t(attribute, post: post),
|
||||||
class: 'form-check-label'
|
class: 'form-check-label'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue