jQuery(function(e){e("table.widefat.wp-list-table tbody th, table.widefat tbody td").css("cursor","move");e("table.widefat.wp-list-table").sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",axis:"y",forcePlaceholderSize:true,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(e,t){if(!t.item.hasClass("alternate"))t.item.css("background-color","#ffffff");t.item.children("td,th").css("border-bottom-width","0");t.item.css("outline","1px solid #aaa")},stop:function(e,t){t.item.removeAttr("style");t.item.children("td,th").css("border-bottom-width","1px")},update:function(t,n){var r=n.item.find(".check-column input").val();var i=n.item.find(".parent").html();var s=n.item.prev().find(".check-column input").val();var o=n.item.next().find(".check-column input").val();var u=undefined;if(s!=undefined){var u=n.item.prev().find(".parent").html();if(u!=i)s=undefined}var a=undefined;if(o!=undefined){a=n.item.next().find(".parent").html();if(a!=i)o=undefined}if(s==undefined&&o==undefined||o==undefined&&a==s||o!=undefined&&u==r){e("table.widefat.wp-list-table").sortable("cancel");return}n.item.find(".check-column input").hide().after('processing');e.post(ajaxurl,{action:"portfolio_update_taxonomy_order",id:r,nextid:o,thetaxonomy:a3_portfolio_term_admin_params.taxonomy},function(e){if(e=="children")window.location.reload();else{n.item.find(".check-column input").show().siblings("img").remove()}});e("table.widefat tbody tr").each(function(){var e=jQuery("table.widefat tbody tr").index(this);if(e%2==0)jQuery(this).addClass("alternate");else jQuery(this).removeClass("alternate")})}})})