Commit 17cec050 authored by Riyad Preukschas's avatar Riyad Preukschas

Make new/edit issue forms use containers on the page instead of adding their own

Fixes #1830
parent 2f5e44a0
function switchToNewIssue(form){ function switchToNewIssue(){
$(".issues_content").hide("fade", { direction: "left" }, 150, function(){ $(".issues_content").hide("fade", { direction: "left" }, 150, function(){
$(".issues_content").after(form);
$('select#issue_assignee_id').chosen(); $('select#issue_assignee_id').chosen();
$('select#issue_milestone_id').chosen(); $('select#issue_milestone_id').chosen();
$("#new_issue_dialog").show("fade", { direction: "right" }, 150); $("#new_issue_dialog").show("fade", { direction: "right" }, 150);
...@@ -10,9 +9,8 @@ function switchToNewIssue(form){ ...@@ -10,9 +9,8 @@ function switchToNewIssue(form){
}); });
} }
function switchToEditIssue(form){ function switchToEditIssue(){
$(".issues_content").hide("fade", { direction: "left" }, 150, function(){ $(".issues_content").hide("fade", { direction: "left" }, 150, function(){
$(".issues_content").after(form);
$('select#issue_assignee_id').chosen(); $('select#issue_assignee_id').chosen();
$('select#issue_milestone_id').chosen(); $('select#issue_milestone_id').chosen();
$("#edit_issue_dialog").show("fade", { direction: "right" }, 150); $("#edit_issue_dialog").show("fade", { direction: "right" }, 150);
...@@ -33,8 +31,8 @@ function switchFromEditIssue(){ ...@@ -33,8 +31,8 @@ function switchFromEditIssue(){
function backToIssues(){ function backToIssues(){
$("#edit_issue_dialog, #new_issue_dialog").hide("fade", { direction: "right" }, 150, function(){ $("#edit_issue_dialog, #new_issue_dialog").hide("fade", { direction: "right" }, 150, function(){
$(".issues_content").show("fade", { direction: "left" }, 150, function() { $(".issues_content").show("fade", { direction: "left" }, 150, function() {
$("#edit_issue_dialog").remove(); $("#edit_issue_dialog").html("");
$("#new_issue_dialog").remove(); $("#new_issue_dialog").html("");
$('.add_new').show(); $('.add_new').show();
}); });
}); });
......
:plain :plain
var edit_issue_dialog = $("<div id='edit_issue_dialog'></div>"); $("#edit_issue_dialog").html("#{escape_javascript(render('form'))}");
edit_issue_dialog.html("#{escape_javascript(render('form'))}"); switchToEditIssue();
switchToEditIssue(edit_issue_dialog);
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
%ul#issues-table.unstyled.issues_table %ul#issues-table.unstyled.issues_table
= render "issues" = render "issues"
#new_issue_dialog
#edit_issue_dialog
:javascript :javascript
$(function(){ $(function(){
......
:plain :plain
var new_issue_dialog = $("<div id='new_issue_dialog'></div>"); $("#new_issue_dialog").html("#{escape_javascript(render('form'))}");
new_issue_dialog.html("#{escape_javascript(render('form'))}"); switchToNewIssue();
switchToNewIssue(new_issue_dialog);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment