diff --git a/app/assets/javascripts/issues.js b/app/assets/javascripts/issues.js index c3cf364f5e2..db3ad7f745c 100644 --- a/app/assets/javascripts/issues.js +++ b/app/assets/javascripts/issues.js @@ -1,6 +1,5 @@ -function switchToNewIssue(form){ +function switchToNewIssue(){ $(".issues_content").hide("fade", { direction: "left" }, 150, function(){ - $(".issues_content").after(form); $('select#issue_assignee_id').chosen(); $('select#issue_milestone_id').chosen(); $("#new_issue_dialog").show("fade", { direction: "right" }, 150); @@ -10,9 +9,8 @@ function switchToNewIssue(form){ }); } -function switchToEditIssue(form){ +function switchToEditIssue(){ $(".issues_content").hide("fade", { direction: "left" }, 150, function(){ - $(".issues_content").after(form); $('select#issue_assignee_id').chosen(); $('select#issue_milestone_id').chosen(); $("#edit_issue_dialog").show("fade", { direction: "right" }, 150); @@ -33,8 +31,8 @@ function switchFromEditIssue(){ function backToIssues(){ $("#edit_issue_dialog, #new_issue_dialog").hide("fade", { direction: "right" }, 150, function(){ $(".issues_content").show("fade", { direction: "left" }, 150, function() { - $("#edit_issue_dialog").remove(); - $("#new_issue_dialog").remove(); + $("#edit_issue_dialog").html(""); + $("#new_issue_dialog").html(""); $('.add_new').show(); }); }); diff --git a/app/views/issues/edit.js.haml b/app/views/issues/edit.js.haml index 76d9e02ecb1..a994572f9b9 100644 --- a/app/views/issues/edit.js.haml +++ b/app/views/issues/edit.js.haml @@ -1,5 +1,4 @@ :plain - var edit_issue_dialog = $("
"); - edit_issue_dialog.html("#{escape_javascript(render('form'))}"); - switchToEditIssue(edit_issue_dialog); + $("#edit_issue_dialog").html("#{escape_javascript(render('form'))}"); + switchToEditIssue(); diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index 22c34baaccd..d89b183d360 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -58,6 +58,8 @@ %ul#issues-table.unstyled.issues_table = render "issues" +#new_issue_dialog +#edit_issue_dialog :javascript $(function(){ diff --git a/app/views/issues/new.js.haml b/app/views/issues/new.js.haml index afa2b86ea92..4cbcc563e28 100644 --- a/app/views/issues/new.js.haml +++ b/app/views/issues/new.js.haml @@ -1,4 +1,3 @@ :plain - var new_issue_dialog = $("
"); - new_issue_dialog.html("#{escape_javascript(render('form'))}"); - switchToNewIssue(new_issue_dialog); + $("#new_issue_dialog").html("#{escape_javascript(render('form'))}"); + switchToNewIssue();