var BuzzyDatatable=function(){"use strict";return{init:function(){!function(){function e(){$(".table").find("td :checked").length>0?$(".table-actions-menu").show():$(".table-actions-menu").hide()}function a(a){$(".overlay").removeClass("hide"),$.ajax({type:"GET",dataType:"json",url:a,success:function(a){setTimeout((function(){t.api().ajax.reload()}),500),setTimeout((function(){$(".cho input[type='checkbox']").iCheck("uncheck"),$(".cho .fa").removeClass("fa-check-square-o").addClass("fa-square-o"),$(".table-actions-menu").removeClass("loading"),$(".overlay").addClass("hide"),e()}),1e3)},error:function(e){swal({type:"warning",title:e.statusText,text:e.responseJSON.errors,timer:2e3,showConfirmButton:!1}),$(".overlay").addClass("hide")}})}$(".doaction").on("click",(function(){var e=$(this).attr("data-url"),t="";$(".table").find("td :checked").each((function(){t+=$(this).val()+","})),""!==t&&a(e+"&ids="+t.slice(0,-1))}));var t=$("#table").dataTable({order:[[parseInt(buzzy_datatable.order),"desc"]],processing:!0,serverSide:!0,autoWidth:!1,language:buzzy_datatable.languages,ajax:{url:buzzy_datatable.ajax_url,data:function(){setTimeout((function(){BuzzyAdmin.init()}),2e3)}},columns:buzzy_datatable.columns,drawCallback:function(t){$('.table input[type="checkbox"]').iCheck({checkboxClass:"icheckbox_flat-blue",radioClass:"iradio_flat-blue"}).on("ifChecked",(function(a){e()})).on("ifUnchecked",(function(a){e()})),$('.cho input[type="checkbox"]').iCheck({checkboxClass:"icheckbox_flat-blue",radioClass:"iradio_flat-blue"}).on("ifChecked",(function(a){e(),$(".table input[type='checkbox']").iCheck("check"),$(".fa",this).removeClass("fa-square-o").addClass("fa-check-square-o")})).on("ifUnchecked",(function(a){e(),$(".table input[type='checkbox']").iCheck("uncheck"),$(".fa",this).removeClass("fa-check-square-o").addClass("fa-square-o")})),$(".do_table_action").on("click",(function(){a($(this).attr("data-url"))}))}})}()}}}();BuzzyDatatable.init();
