gongo/table_beet

View on GitHub
lib/table_beet/formatters/html_template/data/js/plugins/coffee/jquery.responsiveText.js

Summary

Maintainability
D
2 days
Test Coverage
// Generated by CoffeeScript 1.4.0
/*
 *
 *  jQuery ResponsiveText by Gary Hepting - https://github.com/ghepting/responsiveText
 *  
 *  Open source under the BSD License. 
 *
 *  Copyright © 2013 Gary Hepting. All rights reserved.
 *
*/(function(){(function(e){var t;t=[];e.fn.responsiveText=function(n){var r;r={compressor:n.compressor||10,minSize:n.minSize||Number.NEGATIVE_INFINITY,maxSize:n.maxSize||Number.POSITIVE_INFINITY};return this.each(function(){var n;n=e(this);n.attr("data-compression",r.compressor);n.attr("data-min",r.minSize);n.attr("data-max",r.maxSize);n.css("font-size",Math.floor(Math.max(Math.min(n.width()/r.compressor,parseFloat(r.maxSize)),parseFloat(r.minSize))));return t.push(n)})};return e(window).on("resize",function(){return e(t).each(function(){var t;t=e(this);return t.css("font-size",Math.floor(Math.max(Math.min(t.width()/t.attr("data-compression"),parseFloat(t.attr("data-max"))),parseFloat(t.attr("data-min")))))})})})(jQuery)}).call(this);