var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /* Portfolio Sorting */ jQuery(document).ready(function () { (function ($) { var container = $('section.portfolio_container'); function getNumbColumns() { var winWidth = $(window).width(), columnNumb = 1; if (winWidth > 1500) { columnNumb = 6; } else if (winWidth > 1200) { columnNumb = 5; } else if (winWidth > 900) { columnNumb = 4; } else if (winWidth > 600) { columnNumb = 3; } else if (winWidth > 300) { columnNumb = 2; } return columnNumb; } function setColumnWidth() { var winWidth = $(window).width(), columnNumb = getNumbColumns(), postWidth = Math.floor(winWidth / columnNumb); container.find('.portfolio').each(function () { $(this).css( { width : postWidth + 'px' }); }); } $('.gallerySelector .gallerySelectorList a').click(function () { var selector = $(this).attr('data-filter'); $(this).parent().parent().find('> li.current').removeClass('current'); $(this).parent().addClass('current'); container.isotope( { filter : selector }); setTimeout(function () { reArrangeProjects(); }, 300); return false; }); function reArrangeProjects() { setColumnWidth(); container.isotope('reLayout'); } container.imagesLoaded(function () { setColumnWidth(); container.isotope( { itemSelector : 'article.portfolio', layoutMode : 'masonry', resizable : false } ); } ); $(window).on('debouncedresize', function () { reArrangeProjects(); } ); } )(jQuery); } ); /* DebouncedResize Function */ (function ($) { var $event = $.event, $special, resizeTimeout; $special = $event.special.debouncedresize = { setup : function () { $(this).on('resize', $special.handler); }, teardown : function () { $(this).off('resize', $special.handler); }, handler : function (event, execAsap) { var context = this, args = arguments, dispatch = function () { event.type = 'debouncedresize'; $event.dispatch.apply(context, args); }; if (resizeTimeout) { clearTimeout(resizeTimeout); } execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold); }, threshold : 150 }; } )(jQuery); }