From a3519348c6c2b461dd0bbaeede01ecca1939090d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 24 Nov 2017 16:20:50 +0000 Subject: [PATCH] Remove inline javascript from user settings page --- app/assets/javascripts/user.js | 4 ++++ app/views/user/account.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 1c73d3430..bdf044305 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -85,6 +85,10 @@ $(document).ready(function () { $("select#user_auth_provider").on("change", updateAuthUID); + $("input#user_image").on("change", function () { + $("#image_action_new").prop("checked", true); + }); + function enableAuth() { $("#auth_prompt").hide(); $("#auth_field").show(); diff --git a/app/views/user/account.html.erb b/app/views/user/account.html.erb index 92b3407bf..169e5662a 100644 --- a/app/views/user/account.html.erb +++ b/app/views/user/account.html.erb @@ -123,7 +123,7 @@ <%= t 'user.account.replace image' %> <%= t 'user.account.image size hint' %> - <%= f.file_field :image, :onchange => "$('#image_action_new').prop('checked', true)" %> + <%= f.file_field :image %> <% else %>
  • @@ -132,7 +132,7 @@ <%= t 'user.account.new image' %> <%= t 'user.account.image size hint' %> - <%= f.file_field :image, :onchange => "$('#image_action_new').prop('checked', true)" %> + <%= f.file_field :image %>
  • <% end %>
  • -- 2.39.5