2011-11-25 22:40:12 +01:00
|
|
|
function switchToNewIssue(form){
|
2012-01-28 00:49:14 +01:00
|
|
|
$(".issues_content").hide("fade", { direction: "left" }, 150, function(){
|
|
|
|
$(".issues_content").after(form);
|
2011-11-25 22:40:12 +01:00
|
|
|
$('select#issue_assignee_id').chosen();
|
2012-04-08 23:28:58 +02:00
|
|
|
$('select#issue_milestone_id').chosen();
|
2012-01-28 00:49:14 +01:00
|
|
|
$("#new_issue_dialog").show("fade", { direction: "right" }, 150);
|
2012-01-25 08:13:08 +01:00
|
|
|
$('.top-tabs .add_new').hide();
|
2011-11-25 22:40:12 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function switchToEditIssue(form){
|
2012-01-28 00:49:14 +01:00
|
|
|
$(".issues_content").hide("fade", { direction: "left" }, 150, function(){
|
|
|
|
$(".issues_content").after(form);
|
2011-11-25 22:40:12 +01:00
|
|
|
$('select#issue_assignee_id').chosen();
|
2012-04-08 23:28:58 +02:00
|
|
|
$('select#issue_milestone_id').chosen();
|
2012-01-28 00:49:14 +01:00
|
|
|
$("#edit_issue_dialog").show("fade", { direction: "right" }, 150);
|
2012-01-27 07:57:55 +01:00
|
|
|
$('.add_new').hide();
|
2011-11-25 22:40:12 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function switchFromNewIssue(){
|
|
|
|
backToIssues();
|
|
|
|
}
|
|
|
|
|
|
|
|
function switchFromEditIssue(){
|
|
|
|
backToIssues();
|
|
|
|
}
|
|
|
|
|
|
|
|
function backToIssues(){
|
2012-01-28 00:49:14 +01:00
|
|
|
$("#edit_issue_dialog, #new_issue_dialog").hide("fade", { direction: "right" }, 150, function(){
|
|
|
|
$(".issues_content").show("fade", { direction: "left" }, 150, function() {
|
2011-11-25 22:40:12 +01:00
|
|
|
$("#edit_issue_dialog").remove();
|
|
|
|
$("#new_issue_dialog").remove();
|
2012-01-27 07:57:55 +01:00
|
|
|
$('.add_new').show();
|
2011-11-25 22:40:12 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
2012-06-12 10:31:38 +02:00
|
|
|
|
|
|
|
function initIssuesSearch() {
|
|
|
|
var href = $('.issue_search').parent().attr('action');
|
|
|
|
var last_terms = '';
|
|
|
|
|
|
|
|
$('.issue_search').keyup(function() {
|
|
|
|
var terms = $(this).val();
|
|
|
|
var milestone_id = $('#milestone_id').val();
|
|
|
|
var status = $('#status').val();
|
|
|
|
|
|
|
|
if (terms != last_terms) {
|
|
|
|
last_terms = terms;
|
|
|
|
|
|
|
|
if (terms.length >= 2 || terms.length == 0) {
|
|
|
|
$.get(href, { 'f': status, 'terms': terms, 'milestone_id': milestone_id }, function(response) {
|
|
|
|
$('#issues-table').html(response);
|
|
|
|
setSortable();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.delete-issue').live('ajax:success', function() {
|
|
|
|
$(this).closest('tr').fadeOut(); updatePage();
|
|
|
|
});
|
|
|
|
}
|
2012-06-27 22:13:44 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Init issues page
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function issuesPage(){
|
|
|
|
initIssuesSearch();
|
|
|
|
setSortable();
|
|
|
|
$("#label_name").chosen();
|
|
|
|
$("#assignee_id").chosen();
|
|
|
|
$("#milestone_id").chosen();
|
|
|
|
$("#milestone_id, #assignee_id, #label_name").on("change", function(){
|
|
|
|
$(this).closest("form").submit();
|
|
|
|
});
|
|
|
|
}
|