1// Generated by CoffeeScript 1.7.1 2 3/* 4eqHeight.coffee v1.3.2 5http://jsliang.github.com/eqHeight.coffee 6 7Copyright (c) 2013-2014, Jui-Shan Liang <[email protected]> 8All rights reserved. 9Licensed under GPL v2. 10 */ 11 12(function() { 13 var $; 14 15 $ = jQuery; 16 17 $.fn.extend({ 18 eqHeight: function(column_selector, option) { 19 if (option == null) { 20 option = { 21 equalize_interval: null, 22 break_point: null 23 }; 24 } 25 return this.each(function() { 26 var columns, equalizer, infinite_equalizing, start_equalizing, timer, _equalize_marked_columns; 27 timer = null; 28 columns = $(this).find(column_selector); 29 if (columns.length === 0) { 30 columns = $(this).children(column_selector); 31 } 32 if (columns.length === 0) { 33 return; 34 } 35 _equalize_marked_columns = function() { 36 var marked_columns, max_col_height; 37 marked_columns = $(".eqHeight_row"); 38 max_col_height = 0; 39 marked_columns.each(function() { 40 return max_col_height = Math.max($(this).height(), max_col_height); 41 }); 42 marked_columns.height(max_col_height); 43 return $(".eqHeight_row").removeClass("eqHeight_row"); 44 }; 45 equalizer = function() { 46 var row_top_value; 47 columns.height("auto"); 48 if (typeof option.break_point === "number" && $(window).width() <= option.break_point) { 49 return; 50 } 51 row_top_value = columns.first().position().top; 52 columns.each(function() { 53 var current_top; 54 current_top = $(this).position().top; 55 if (current_top !== row_top_value) { 56 _equalize_marked_columns(); 57 row_top_value = $(this).position().top; 58 } 59 return $(this).addClass("eqHeight_row"); 60 }); 61 return _equalize_marked_columns(); 62 }; 63 start_equalizing = function() { 64 clearTimeout(timer); 65 return timer = setTimeout(equalizer, 100); 66 }; 67 infinite_equalizing = function() { 68 equalizer(); 69 return timer = setTimeout(infinite_equalizing, option.equalize_interval); 70 }; 71 $(window).load(equalizer); 72 if (typeof option.equalize_interval === "number") { 73 return infinite_equalizing(); 74 } else { 75 return $(window).resize(start_equalizing); 76 } 77 }); 78 } 79 }); 80 81}).call(this);
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.