1(function($, window, document, undefined) { 2 'use strict'; 3 4 var gridContainer = $('#grid-container5'), 5 filtersContainer = $('#filters-container'), 6 wrap, filtersCallback; 7 8 9 /********************************* 10 init cubeportfolio 11 *********************************/ 12 gridContainer.cubeportfolio({ 13 layoutMode: 'grid', 14 rewindNav: true, 15 scrollByPage: false, 16 defaultFilter: '*', 17 animationType: 'slideLeft', 18 gapHorizontal: 20, 19 gapVertical: 20, 20 gridAdjustment: 'responsive', 21 mediaQueries: [{ 22 width: 800, 23 cols: 5 24 }, { 25 width: 500, 26 cols: 2 27 }, { 28 width: 320, 29 cols: 1 30 }], 31 caption: 'zoom', 32 displayType: 'lazyLoading', 33 displayTypeSpeed: 100 34 }); 35 36 37 /********************************* 38 add listener for filters 39 *********************************/ 40 if (filtersContainer.hasClass('cbp-l-filters-dropdown')) { 41 wrap = filtersContainer.find('.cbp-l-filters-dropdownWrap'); 42 43 wrap.on({ 44 'mouseover.cbp': function() { 45 wrap.addClass('cbp-l-filters-dropdownWrap-open'); 46 }, 47 'mouseleave.cbp': function() { 48 wrap.removeClass('cbp-l-filters-dropdownWrap-open'); 49 } 50 }); 51 52 filtersCallback = function(me) { 53 wrap.find('.cbp-filter-item').removeClass('cbp-filter-item-active'); 54 wrap.find('.cbp-l-filters-dropdownHeader').text(me.text()); 55 me.addClass('cbp-filter-item-active'); 56 wrap.trigger('mouseleave.cbp'); 57 }; 58 } else { 59 filtersCallback = function(me) { 60 me.addClass('cbp-filter-item-active').siblings().removeClass('cbp-filter-item-active'); 61 }; 62 } 63 64 filtersContainer.on('click.cbp', '.cbp-filter-item', function() { 65 var me = $(this); 66 67 if (me.hasClass('cbp-filter-item-active')) { 68 return; 69 } 70 71 // get cubeportfolio data and check if is still animating (reposition) the items. 72 if (!$.data(gridContainer[0], 'cubeportfolio').isAnimating) { 73 filtersCallback.call(null, me); 74 } 75 76 // filter the items 77 gridContainer.cubeportfolio('filter', me.data('filter'), function() {}); 78 }); 79 80 81 /********************************* 82 activate counter for filters 83 *********************************/ 84 gridContainer.cubeportfolio('showCounter', filtersContainer.find('.cbp-filter-item'), function() { 85 // read from url and change filter active 86 var match = /#cbpf=(.*?)([#|?&]|$)/gi.exec(location.href), 87 item; 88 if (match !== null) { 89 item = filtersContainer.find('.cbp-filter-item').filter('[data-filter="' + match[1] + '"]'); 90 if (item.length) { 91 filtersCallback.call(null, item); 92 } 93 } 94 }); 95 96})(jQuery, window, document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.