Commit f0217b57 by Kálmán Viktor

dashboard: fix modal

parent c9159549
...@@ -40,17 +40,18 @@ $(function() { ...@@ -40,17 +40,18 @@ $(function() {
type: 'POST', type: 'POST',
data: $(this).closest('form').serialize(), data: $(this).closest('form').serialize(),
success: function(data, textStatus, xhr) { success: function(data, textStatus, xhr) {
var r = $('#confirmation-modal'); r.next('div').remove(); r.remove(); $('#confirmation-modal').modal("hide");
if(data.redirect) { if(data.redirect) {
$('a[href="#activity"]').trigger("click"); $('a[href="#activity"]').trigger("click");
} }
else { else {
$('body').append(data); var r = $('#confirmation-modal'); r.next('div').remove(); r.remove();
$('#confirmation-modal').modal('show'); $('body').append(data);
$('#confirmation-modal').on('hidden.bs.modal', function() { $('#confirmation-modal').modal('show');
$('#confirmation-modal').remove(); $('#confirmation-modal').on('hidden.bs.modal', function() {
}); $('#confirmation-modal').remove();
});
} }
}, },
error: function(xhr, textStatus, error) { error: function(xhr, textStatus, error) {
......
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 sign in to comment