Sha256: ec57b6b8bb4ca5cc6d8927f30e5f42ddffd940315ceda89353a79ba315158be4
Contents?: true
Size: 1.69 KB
Versions: 40
Compression:
Stored size: 1.69 KB
Contents
;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.equalizer = { name : 'equalizer', version : '5.1.1', settings : { use_tallest: true, before_height_change: $.noop, after_height_change: $.noop }, init : function (scope, method, options) { this.bindings(method, options); this.reflow(); }, events : function () { this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function(e){ this.reflow(); }.bind(this)); }, equalize: function(equalizer) { var isStacked = false, vals = equalizer.find('[' + this.attr_name() + '-watch]'), firstTopOffset = vals.first().offset().top, settings = equalizer.data(this.attr_name(true)+'-init'); if (vals.length === 0) return; settings.before_height_change(); equalizer.trigger('before-height-change'); vals.height('inherit'); vals.each(function(){ var el = $(this); if (el.offset().top !== firstTopOffset) { isStacked = true; } }); if (isStacked) return; var heights = vals.map(function(){ return $(this).outerHeight() }); if (settings.use_tallest) { var max = Math.max.apply(null, heights); vals.height(max); } else { var min = Math.min.apply(null, heights); vals.height(min); } settings.after_height_change(); equalizer.trigger('after-height-change'); }, reflow : function () { var self = this; this.S('[' + this.attr_name() + ']', this.scope).each(function(){ self.equalize($(this)); }); } }; }(jQuery, this, this.document));
Version data entries
40 entries across 40 versions & 1 rubygems