]> source.dussan.org Git - redmine.git/commitdiff
Fixed wrong password rendering broken by r14339 (#19851).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 19 Jun 2015 20:12:24 +0000 (20:12 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 19 Jun 2015 20:12:24 +0000 (20:12 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@14341 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/sudo_mode/new.js.erb

index ed77b32b13c7159b6fdab72992e2f07a8a83c3d8..2eda9b857ddb32d7eabb577b1d8e0d5e0a4aabf0 100644 (file)
@@ -1,4 +1,4 @@
-$("body").append($("<div>", {id: "sudo-modal"}).hide());
-$('#sudo-modal').html('<%= escape_javascript render partial: 'sudo_mode/new_modal' %>');
+var sudo_modal = $('#sudo-modal').length ? $('#sudo-modal') : $("<div>", {id: "sudo-modal"}).appendTo($("body"));
+sudo_modal.hide().html('<%= escape_javascript render partial: 'sudo_mode/new_modal' %>');
 showModal('sudo-modal', '400px');
 $('#sudo_password').focus();