Merge pull request #3741 from tchak/fix-sentry-error

Fix Identifier 'fileInputSelector' has already been declared
This commit is contained in:
Pierre de La Morinerie 2019-04-04 10:45:44 +02:00 committed by GitHub
commit fb19b856c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -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;")

View file

@ -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');