HEX
Server: Apache
System: Linux p3plzcpnl489499.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: dwauav0tm6jp (6177017)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dwauav0tm6jp/hosted/jeffreyjhart_com/wp-content/themes/skylab-old/js/jquery.portfolio.js
jQuery(document).ready(function(){
	// Isotope
		// modified Isotope methods for gutters in masonry
		jQuery.Isotope.prototype._getMasonryGutterColumns = function() {
			var gutter = this.options.masonry && this.options.masonry.gutterWidth || 0;
				containerWidth = this.element.width();
  
		this.masonry.columnWidth = this.options.masonry && this.options.masonry.columnWidth ||
                  // or use the size of the first item
                  this.$filteredAtoms.outerWidth(true) ||
                  // if there's no items, use size of container
                  containerWidth;

		this.masonry.columnWidth += gutter;

		this.masonry.cols = Math.floor( ( containerWidth + gutter ) / this.masonry.columnWidth );
		this.masonry.cols = Math.max( this.masonry.cols, 1 );
		};

		jQuery.Isotope.prototype._masonryReset = function() {
			// layout-specific props
			this.masonry = {};
			// FIXME shouldn't have to call this again
			this._getMasonryGutterColumns();
			var i = this.masonry.cols;
			this.masonry.colYs = [];
			while (i--) {
				this.masonry.colYs.push( 0 );
			}
		};

		jQuery.Isotope.prototype._masonryResizeChanged = function() {
			var prevSegments = this.masonry.cols;
			// update cols/rows
			this._getMasonryGutterColumns();
			// return if updated cols/rows is not equal to previous
			return ( this.masonry.cols !== prevSegments );
		};
  
		// cache jQuery window
		var $window = jQuery(window);
  
		// cache container
		var $container = jQuery('#portfolio, #portfolio-fixed-width');
		
		// start up isotope with default settings
		$container.imagesLoaded( function(){
			reLayout();
			$window.smartresize( reLayout );
		});
		
		function reLayout() {
  
			var mediaQueryId = getComputedStyle( document.body, ':after' ).getPropertyValue('content');
			// fix for firefox, remove double quotes "
			if (navigator.userAgent.match('MSIE 8') == null) {
				mediaQueryId = mediaQueryId.replace( /"/g, '' );
			}
			//console.log( mediaQueryId );
			var windowSize = $window.width();
			var masonryOpts;
			var IS_PORTFOLIO_FIXED_WIDTH = jQuery('.page-template-page-portfolio-fixed-width-php');
			// update sizing options 
			switch ( mediaQueryId ) {
				case 'large' :
					if ( IS_PORTFOLIO_FIXED_WIDTH.length <= 0 ) {
						colWidth = 5;
					} else {
						colWidth = 6;
					}
					masonryOpts = {
					  columnWidth: $container.width() / parseInt( colWidth ),
					};
				break;
				case 'big' :
					if ( megaPortfolio.portfolio_columns == 'portfolio_four_columns' ) {
						colWidth = 4;
					} else {
						colWidth = 3;
					}
					masonryOpts = {
					  columnWidth: $container.width() / parseInt( colWidth ),
					};
				break;
				
				case 'medium' :
					if ( megaPortfolio.portfolio_columns == 'portfolio_four_columns' ) {
						colWidth = 4;
					} else {
						colWidth = 3;
					}
					masonryOpts = {
					  columnWidth: $container.width() / parseInt( colWidth ),
					};
				break;
				
				case 'small' :
					masonryOpts = {
						columnWidth: $container.width() / 3
					};
				break;
				
				case 'tiny' :
				masonryOpts = {
				  columnWidth: $container.width() / 1
				};
				break;
			}

			$container.isotope({
			  resizable: false, // disable resizing by default, we'll trigger it manually
			  itemSelector : '.hentry',
			  masonry: masonryOpts
			}).isotope( 'reLayout' );

		}

		// filter items when filter link is clicked
		jQuery('#filters a').click(function() {
			var selector = jQuery(this).attr('data-filter');
			$container.isotope({ filter: selector });
			
			setTimeout(function(){
				reLayout();
			}, 1000 );
			
			return false;
		});
		
		// set selected menu items
		var $optionSets = jQuery('.option-set'),
			$optionLinks = $optionSets.find('a');
 
			$optionLinks.click(function(){
				var $this = jQuery(this);
				// don't proceed if already selected
				if ( $this.hasClass('selected') ) {
					return false;
				}
				var $optionSet = $this.parents('.option-set');
				$optionSet.find('.selected').removeClass('selected');
				$this.addClass('selected'); 
			});
});