From b99a6f11f3b32f9d48efb7659e47a1ff12387311 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 13 Dec 2012 12:42:10 +0000 Subject: [PATCH] Fixed: clicking journal edit multiple times shows multiple forms (#12568). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10991 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/journals/edit.js.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/journals/edit.js.erb b/app/views/journals/edit.js.erb index 73b8082a4..96cf6b4f8 100644 --- a/app/views/journals/edit.js.erb +++ b/app/views/journals/edit.js.erb @@ -1,2 +1,8 @@ $("#journal-<%= @journal.id %>-notes").hide(); -$("#journal-<%= @journal.id %>-notes").after('<%= escape_javascript(render :partial => 'notes_form') %>'); + +if ($("form#journal-<%= @journal.id %>-form").length > 0) { + // journal edit form already loaded + $("#journal-<%= @journal.id %>-form").show(); +} else { + $("#journal-<%= @journal.id %>-notes").after('<%= escape_javascript(render :partial => 'notes_form') %>'); +}