Sha256: a294de03eae4eca98c368444e2535a0b104ea9c5f95aff08ea4721fdcfcf1cd9

Contents?: true

Size: 1.72 KB

Versions: 5

Compression:

Stored size: 1.72 KB

Contents

/*
Template Name: Color Admin - Responsive Admin Dashboard Template build with Twitter Bootstrap 5
Version: 5.1.5
Author: Sean Ngu
Website: http://www.seantheme.com/color-admin/
*/

function calculateDivider() {
	var dividerValue = 4;
	if ($(this).width() <= 576) {
		dividerValue = 1;
	} else if ($(this).width() <= 992) {
		dividerValue = 2;
	} else if ($(this).width() <= 1200) {
		dividerValue = 3;
	}
	return dividerValue;
}
var handleIsotopesGallery = function() {
	"use strict";
	var container = $('#gallery');
	var dividerValue = calculateDivider();
	var containerWidth = $(container).width();
	var columnWidth = containerWidth / dividerValue;
	$(container).isotope({
		resizable: true,
		masonry: {
			columnWidth: columnWidth
		}
	});
	
	$(window).on('resize', function() {
		var dividerValue = calculateDivider();
		var containerWidth = $(container).width();
		var columnWidth = containerWidth / dividerValue;
		$(container).isotope({
			masonry: { 
				columnWidth: columnWidth 
			}
		});
	});
	
	var $optionSets = $('#options #filter'),
	$optionLinks = $optionSets.find('a');
	
	$optionLinks.click( function(){
		var $this = $(this);
		if ($this.hasClass('active')) {
			return false;
		}
		var $optionSet = $this.parents('#filter');
		$optionSet.find('.active').removeClass('active');
		$this.addClass('active');
	
		var options = {};
		var key = $optionSet.attr('data-option-key');
		var value = $this.attr('data-option-value');
			value = value === 'false' ? false : value;
			options[ key ] = value;
		$(container).isotope( options );
		return false;
	});
};


var Gallery = function () {
	"use strict";
	return {
		//main function
		init: function () {
			handleIsotopesGallery();
		}
	};
}();

$(document).ready(function() {
	Gallery.init();
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
phcthemes_admin_panel_pack-7.0.0 app/assets/dist/themes/coloradmin/js/demo/gallery.demo.js
phcthemes_admin_panel_pack-6.0.3 app/assets/dist/themes/coloradmin/js/demo/gallery.demo.js
phcthemes_admin_panel_pack-6.0.2 app/assets/dist/themes/coloradmin/js/demo/gallery.demo.js
phcthemes_admin_panel_pack-6.0.1 app/assets/dist/themes/coloradmin/js/demo/gallery.demo.js
phcthemes_admin_panel_pack-6.0.0 app/assets/dist/themes/coloradmin/js/demo/gallery.demo.js