From 57287e6b6609f4e4764582b692452d80ad48bb11 Mon Sep 17 00:00:00 2001 From: Matheus Lins Date: Thu, 20 Oct 2016 03:20:52 -0300 Subject: [PATCH] puting de modal delete in remove category #177 --- courses/static/js/modal_category.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+), 0 deletions(-) create mode 100644 courses/static/js/modal_category.js diff --git a/courses/static/js/modal_category.js b/courses/static/js/modal_category.js new file mode 100644 index 0000000..2ca9cef --- /dev/null +++ b/courses/static/js/modal_category.js @@ -0,0 +1,30 @@ + +var Submite = { + remove: function(url,dados,id_li_link){ + $('#category').modal('hide'); + $.post(url,dados, function(data){ + $(id_li_link).remove(); + $("#modal_category").empty(); + $("div.modal-backdrop.fade.in").remove(); + alertify.success("Category removed successfully!"); + }).fail(function(){ + $("#modal_category").empty(); + $("#modal_category").append(data); + $('#category').modal('show'); + }); + } +} + +var modal = { + get: function (url, id_modal, id_div_modal){ + $.get(url, function(data){ + if($(id_modal).length){ + $(id_div_modal).empty(); + $(id_div_modal).append(data); + } else { + $(id_div_modal).append(data); + } + $(id_modal).modal('show'); + }); + } +}; \ No newline at end of file -- libgit2 0.21.2