handle focus during and after upload
This commit is contained in:
parent
43039d1755
commit
df3bd3a1d2
3 changed files with 9 additions and 0 deletions
|
@ -79,6 +79,12 @@ module ApplicationHelper
|
|||
# rubocop:enable Rails/OutputSafety
|
||||
end
|
||||
|
||||
def focus_element(selector)
|
||||
# rubocop:disable Rails/OutputSafety
|
||||
raw("document.querySelector('#{selector}').focus();")
|
||||
# rubocop:enable Rails/OutputSafety
|
||||
end
|
||||
|
||||
def disable_element(selector)
|
||||
# rubocop:disable Rails/OutputSafety
|
||||
raw("document.querySelector('#{selector}').disabled = true;")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue