$(".gallery-sortable").each(function(index, el) {
var tabList = ["All"];
$(".gallery-sortable li").each(function(index, el) {
var category = $(this).attr("class");
category = category.replace(" ui-sortable-handle", "");
$.inArray(category, tabList)
if ($.inArray(category, tabList) > -1) {
} else {
tabList.push(category);
}
});
var tabHtml = "<div class='galleryTabMenu'><ul>";
$.each(tabList, function(index, el) {
tabHtml += "<li class='menuTab' data-galtoggle='"+this+"'>"+this+"</li>"
});
tabHtml += "</ul></div>"
$(this).prepend(tabHtml);
});
$(".galleryTabMenu li").on('click', function(event) {
event.preventDefault();
var showHide = "."+$(this).data('galtoggle');
if (showHide === ".All") {
$(".galleryTabMenu li").parent().parent().parent().find(".ui-sortable li").fadeIn();
} else {
$(".galleryTabMenu li").parent().parent().parent().find(".ui-sortable li").fadeOut();
$(showHide).fadeIn();
}
});