Merge pull request #3741 from tchak/fix-sentry-error
Fix Identifier 'fileInputSelector' has already been declared
This commit is contained in:
commit
fb19b856c5
2 changed files with 7 additions and 3 deletions
|
@ -60,6 +60,12 @@ module ApplicationHelper
|
||||||
# rubocop:enable Rails/OutputSafety
|
# rubocop:enable Rails/OutputSafety
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show_element(selector)
|
||||||
|
# rubocop:disable Rails/OutputSafety
|
||||||
|
raw("document.querySelector('#{selector}').classList.remove('hidden');")
|
||||||
|
# rubocop:enable Rails/OutputSafety
|
||||||
|
end
|
||||||
|
|
||||||
def disable_element(selector)
|
def disable_element(selector)
|
||||||
# rubocop:disable Rails/OutputSafety
|
# rubocop:disable Rails/OutputSafety
|
||||||
raw("document.querySelector('#{selector}').disabled = true;")
|
raw("document.querySelector('#{selector}').disabled = true;")
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
<%= render_flash(timeout: 5000, sticky: true) %>
|
<%= render_flash(timeout: 5000, sticky: true) %>
|
||||||
<%= remove_element("#piece_justificative_#{@champ.id}") %>
|
<%= remove_element("#piece_justificative_#{@champ.id}") %>
|
||||||
|
<%= show_element("#champs_#{@champ.id}") %>
|
||||||
let fileInputSelector = '<%= "#champs_#{@champ.id}" %>';
|
|
||||||
document.querySelector(fileInputSelector).classList.remove('hidden');
|
|
||||||
|
|
Loading…
Reference in a new issue