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").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();
});
});
......
:plain
var edit_issue_dialog = $("<div id='edit_issue_dialog'></div>");
edit_issue_dialog.html("#{escape_javascript(render('form'))}");
switchToEditIssue(edit_issue_dialog);
$("#edit_issue_dialog").html("#{escape_javascript(render('form'))}");
switchToEditIssue();
......@@ -58,6 +58,8 @@
%ul#issues-table.unstyled.issues_table
= render "issues"
#new_issue_dialog
#edit_issue_dialog
:javascript
$(function(){
......
:plain
var new_issue_dialog = $("<div id='new_issue_dialog'></div>");
new_issue_dialog.html("#{escape_javascript(render('form'))}");
switchToNewIssue(new_issue_dialog);
$("#new_issue_dialog").html("#{escape_javascript(render('form'))}");
switchToNewIssue();
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