function call_thumbs_animation(){

    if (jQuery().quicksand) {
        // Clone applications to get a second collection
        var $data = $(".portfolio").clone();
        //NOTE: Only filter on the main portfolio page, not on the subcategory pages
        $('.filter li').click(function(e) {
            $(".filter li").removeClass("active");
            // Use the last category class as the category to filter by. This means that multiple categories are not supported (yet)
            var filterClass=$(this).attr('class').split(' ').slice(-1)[0];

            if (filterClass == 'all') {
                var $filteredData = $data.find('.item-thumbs');
            } else {
                var $filteredData = $data.find('.item-thumbs[data-type=' + filterClass + ']');
            }
            //console.log($filteredData)
            //BUG-FIX:  manually filter by checking duplicate ids because of dynamic content
            var arr = [];
            var deleteArr = [];
            $.each($filteredData, function(i, item){
                if($.inArray(item.dataset.id, arr) > -1){
                    //store the elements to be deleted, do not delete here because it messes up the indexes
                    deleteArr.push(i)
                } else {
                    arr.push(item.dataset.id)
                }
            });

            deleteArr = deleteArr.sort(function(a, b){return b-a}) //descending order
            $.each(deleteArr, function(i, item){
                $filteredData.splice(item,1)
            });
            //BUG-FIX -- end --
            //console.log($filteredData)

            $(".portfolio").quicksand($filteredData, {
                duration: 600,
                adjustHeight: 'auto'
            }, function () {

                //$("a[data-pretty^='prettyPhoto']").prettyPhoto();

            });

            $(this).addClass("active");
            return false;
        });

    }//if quicksand
}
//Call the function again because the elements were dynamically loaded
Call the function again because the elements were dynamically loaded
Call the function again because the elements were dynamically loaded
function call_thumbs_animation(){
    if (jQuery().quicksand) {
        var $data = $(".portfolio").clone();
        $('.filter li').click(function(e) {
            $(".filter li").removeClass("active");
            var filterClass=$(this).attr('class').split(' ').slice(-1)[0];
            if (filterClass == 'all') {
                var $filteredData = $data.find('.item-thumbs');
            } else {
                var $filteredData = $data.find('.item-thumbs[data-type=' + filterClass + ']');
            }
            var arr = [];
            var deleteArr = [];
            $.each($filteredData, function(i, item){
                if($.inArray(item.dataset.id, arr) > -1){
                    deleteArr.push(i)
                } else {
                    arr.push(item.dataset.id)
                }
            });
            deleteArr = deleteArr.sort(function(a, b){return b-a}) 
            $.each(deleteArr, function(i, item){
                $filteredData.splice(item,1)
            });
            $(".portfolio").quicksand($filteredData, {
                duration: 600,
                adjustHeight: 'auto'
            }, function () {
            });
            $(this).addClass("active");
            return false;
        });
    }
}
function call_thumbs_animation ( ) { if ( jQuery ( ) . quicksand ) { var $data = $ ( ".portfolio" ) . clone ( ) ; $ ( '.filter li' ) . click ( function ( e ) { $ ( ".filter li" ) . removeClass ( "active" ) ; var filterClass = $ ( this ) . attr ( 'class' ) . split ( ' ' ) . slice ( - 1 ) [ 0 ] ; if ( filterClass == 'all' ) { var $filteredData = $data . find ( '.item-thumbs' ) ; } else { var $filteredData = $data . find ( '.item-thumbs[data-type=' + filterClass + ']' ) ; } var arr = [ ] ; var deleteArr = [ ] ; $ . each ( $filteredData , function ( i , item ) { if ( $ . inArray ( item . dataset . id , arr ) > - 1 ) { deleteArr . push ( i ) } else { arr . push ( item . dataset . id ) } } ) ; deleteArr = deleteArr . sort ( function ( a , b ) { return b - a } ) $ . each ( deleteArr , function ( i , item ) { $filteredData . splice ( item , 1 ) } ) ; $ ( ".portfolio" ) . quicksand ( $filteredData , { duration : 600 , adjustHeight : 'auto' } , function ( ) { } ) ; $ ( this ) . addClass ( "active" ) ; return false ; } ) ; } }
Call the function again because the elements were dynamically loaded
Call the function again because the elements were dynamically loaded
// Clone applications to get a second collection //NOTE: Only filter on the main portfolio page, not on the subcategory pages // Use the last category class as the category to filter by. This means that multiple categories are not supported (yet) //console.log($filteredData) //BUG-FIX:  manually filter by checking duplicate ids because of dynamic content //store the elements to be deleted, do not delete here because it messes up the indexes //descending order //BUG-FIX -- end -- //console.log($filteredData) //$("a[data-pretty^='prettyPhoto']").prettyPhoto(); //if quicksand