$.fn.raty.defaults.path="../../../app-assets/images/raty/",$(document).ready((function(){if($(".sidebar-detached.sidebar-left").length>0)new PerfectScrollbar(".sidebar-detached.sidebar-left",{wheelPropagation:!1});$("input#checkboxsmallall").on("click",(function(){$("input:checked#checkboxsmallall").length>0?$("input:not(:checked)").prop("checked",!0):$("input:checked").prop("checked",!1)}));var a=$("#users-contacts").DataTable({order:[[1,""]]});$("#search-contacts").on("keyup",(function(){a.search(this.value).draw()})),a.on("draw.dt",(function(){$(".favorite").on("click",(function(){$(this).toggleClass("active"),$(".favorite").raty({number:1,hints:["Favorite"]}),$(".favorite.active").raty({number:1,hints:["Favorite"],score:1})})),$(".favorite").raty({number:1,hints:["Favorite"]}),$(".favorite.active").raty({number:1,hints:["Favorite"],score:1})})),$(".favorite").on("click",(function(){$(this).toggleClass("active"),$(".favorite").raty({number:1,hints:["Favorite"]}),$(".favorite.active").raty({number:1,hints:["Favorite"],score:1})})),$(".favorite").raty({number:1,hints:["Favorite"]}),$(".favorite.active").raty({number:1,hints:["Favorite"],score:1});$("#add-contact-item").on("click",(function(e){e.preventDefault();var t=$("#contact-name").val(),s=$("#contact-email").val(),o=$("#contact-phone").val(),l=($("#user-image").val(),"");"on"==$("#favorite:checked").val()&&(l=" active"),a.row.add(['
','",''+s+"",''+o+"",'','']).draw(!1)}));var e=null;$(document).on("click",".edit",(function(){e=$(this).parents("tr"),$("#phone").val(""),$("#name").val($(this).closest("tr").find("td .name").text()),$("#email").val($(this).closest("tr").find(".email").text()),$("#phone").val($(this).closest("tr").find("td.phone","td .phone").text()),$("#fav").val(""),$(this).closest("tr").find(".favorite").hasClass("active")&&$("#fav").text("active")})),$("#edit-contact-item").on("click",(function(t){t.preventDefault();var s=$("#name").val(),o=$("#email").val(),l=$("#phone").val(),i=$("#fav").text();a.row(e).data(['','",''+o+"",''+l+"",'','']).draw()})),$(".modal").on("hidden.bs.modal",(function(){$(".modal-body input").val("")})),$("#users-contacts").on("click",".delete",(function(){a.row($(this).parents("tr")).remove().draw()})),$(".menu-toggle").on("click",(function(a){$(".app-content .sidebar-left").removeClass("show"),$(".app-content .content-overlay").removeClass("show")})),$(".sidebar-toggle").on("click",(function(a){a.stopPropagation(),$(".app-content .sidebar-left").toggleClass("show"),$(".app-content .content-overlay").addClass("show")})),$(".app-content .content-overlay").on("click",(function(a){$(".app-content .sidebar-left").removeClass("show"),$(".app-content .content-overlay").removeClass("show")})),$(window).width()>992&&$(".app-content .content-overlay").hasClass("show")&&$(".app-content .content-overlay").removeClass("show")})),$(window).on("resize",(function(){$(window).width()>992&&$(".app-content .content-overlay").hasClass("show")&&($(".app-content .sidebar-left").removeClass("show"),$(".app-content .content-overlay").removeClass("show"))}));