Skip to content

Instantly share code, notes, and snippets.

@tanordheim
Created February 2, 2012 19:36
Show Gist options
  • Save tanordheim/1725299 to your computer and use it in GitHub Desktop.
Save tanordheim/1725299 to your computer and use it in GitHub Desktop.
$('.modal').modal('hideModal');
$('.modal, .modal-backdrop').remove();
<% if ticket.errors.any? -%>
$("<%= escape_javascript(render('form')) %>").modal();
<% else -%>
if ($('table.tickets[data-milestone-id]').length > 0) {
// Milestone ticket list.
var milestoneId = $('table.tickets[data-milestone-id]').attr('data-milestone-id');
$.getScript("/projects/<%= ticket.project.id %>/milestones/" + milestoneId, function() {
$('tr[data-ticket-id="<%= ticket.id %>"]').effect('highlight', {}, 500);
});
} else if ($('table.tickets').length > 0) {
// Full ticket list.
$.getScript("/projects/<%= ticket.project.id %>/tickets", function() {
$('tr[data-ticket-id="<%= ticket.id %>"]').effect('highlight', {}, 500);
});
} else if ($('header.ticket-header').length > 0) {
// Show-view.
$.getScript("/projects/<%= ticket.project.id %>/tickets/<%= ticket.id %>");
}
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment