Sha256: 95f4ac822f4b1c43515354f52fc49f51abe3d62e207b4ecc226d57690fe4f8a9

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

/*
 * jQuery autoResize (textarea auto-resizer)
 * @copyright James Padolsey http://james.padolsey.com
 * @version 1.04
 */

(function(a){a.fn.autoResize=function(j){var b=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},j);this.filter('textarea').each(function(){var c=a(this).css({resize:'none','overflow-y':'hidden'}),k=c.height(),f=(function(){var l=['height','width','lineHeight','textDecoration','letterSpacing'],h={};a.each(l,function(d,e){h[e]=c.css(e)});return c.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(h).attr('tabIndex','-1').insertBefore(c)})(),i=null,g=function(){f.height(0).val(a(this).val()).scrollTop(10000);var d=Math.max(f.scrollTop(),k)+b.extraSpace,e=a(this).add(f);if(i===d){return}i=d;if(d>=b.limit){a(this).css('overflow-y','');return}b.onResize.call(this);b.animate&&c.css('display')==='block'?e.stop().animate({height:d},b.animateDuration,b.animateCallback):e.height(d)};c.unbind('.dynSiz').bind('keyup.dynSiz',g).bind('keydown.dynSiz',g).bind('change.dynSiz',g)});return this}})(jQuery);

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
orange-sparkles-0.7.1 lib/orange-sparkles/assets/js/autoresize.jquery.min.js
orange-sparkles-0.7.0 lib/orange-sparkles/assets/js/autoresize.jquery.min.js
orange-sparkles-0.5.9 lib/orange-sparkles/assets/js/autoresize.jquery.min.js
orange-sparkles-0.5.8 lib/orange-sparkles/assets/js/autoresize.jquery.min.js
orange-sparkles-0.5.7 lib/orange-sparkles/assets/js/autoresize.jquery.min.js