diff --git a/jquery.autosize-min.js b/jquery.autosize-min.js
index 4a1b706..9ebd993 100644
--- a/jquery.autosize-min.js
+++ b/jquery.autosize-min.js
@@ -1,7 +1 @@
-/*!
- Autosize v1.17.2 - 2013-07-28
- Automatically adjust textarea height based on user input.
- (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize
- license: http://www.opensource.org/licenses/mit-license.php
-*/
-(function(e){"function"==typeof define&&define.amd?define("jquery-autosize",["jquery"],e):e(window.jQuery||window.$)})(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var o,a={};if(t=c,s.className=i.className,l=parseInt(h.css("maxHeight"),10),e.each(n,function(e,t){a[t]=h.css(t)}),e(s).css(a),"oninput"in c){var r=c.style.width;c.style.width="0px",o=c.offsetWidth,c.style.width=r}}function a(){var n,a,r,u;t!==c&&o(),s.value=c.value+i.append,s.style.overflowY=c.style.overflowY,a=parseInt(c.style.height,10),"getComputedStyle"in window?(u=window.getComputedStyle(c),r=c.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,t){r-=parseInt(u[t],10)}),s.style.width=r+"px"):s.style.width=Math.max(h.width(),0)+"px",s.scrollTop=0,s.scrollTop=9e4,n=s.scrollTop,l&&n>l?(c.style.overflowY="scroll",n=l):(c.style.overflowY="hidden",d>n&&(n=d)),n+=p,a!==n&&(c.style.height=n+"px",f&&i.callback.call(c,c))}function r(){clearTimeout(u),u=setTimeout(function(){h.width()!==z&&a()},parseInt(i.resizeDelay,10))}var l,d,u,c=this,h=e(c),p=0,f=e.isFunction(i.callback),w={height:c.style.height,overflow:c.style.overflow,overflowY:c.style.overflowY,wordWrap:c.style.wordWrap,resize:c.style.resize},z=h.width();h.data("autosize")||(h.data("autosize",!0),("border-box"===h.css("box-sizing")||"border-box"===h.css("-moz-box-sizing")||"border-box"===h.css("-webkit-box-sizing"))&&(p=h.outerHeight()-h.height()),d=Math.max(parseInt(h.css("minHeight"),10)-p||0,h.height()),h.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===h.css("resize")||"vertical"===h.css("resize")?"none":"horizontal"}),"onpropertychange"in c?"oninput"in c?h.on("input.autosize keyup.autosize",a):h.on("propertychange.autosize",function(){"value"===event.propertyName&&a()}):h.on("input.autosize",a),i.resizeDelay!==!1&&e(window).on("resize.autosize",r),h.on("autosize.resize",a),h.on("autosize.resizeIncludeStyle",function(){t=null,a()}),h.on("autosize.destroy",function(){t=null,clearTimeout(u),e(window).off("resize",r),h.off("autosize").off(".autosize").css(w).removeData("autosize")}),a())})}});
\ No newline at end of file
+!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(window.jQuery||window.$)}(function($){var mirrored,defaults={className:"autosizejs",append:"",callback:!1,resizeDelay:10},copy='',typographyStyles=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],mirror=$(copy).data("autosize",!0)[0];mirror.style.lineHeight="99px","99px"===$(mirror).css("lineHeight")&&typographyStyles.push("lineHeight"),mirror.style.lineHeight="",$.fn.autosize=function(options){return options=$.extend({},defaults,options||{}),mirror.parentNode!==document.body&&$(document.body).append(mirror),this.each(function(){function initMirror(){var ignore,styles={};if(mirrored=ta,mirror.className=options.className,maxHeight=parseInt($ta.css("maxHeight"),10),$.each(typographyStyles,function(i,val){styles[val]=$ta.css(val)}),$(mirror).css(styles),"oninput"in ta){var width=ta.style.width;ta.style.width="0px",ignore=ta.offsetWidth,ta.style.width=width}}function adjust(){var height,original,width,style;mirrored!==ta&&initMirror(),mirror.value=ta.value+options.append,mirror.style.overflowY=ta.style.overflowY,original=parseInt(ta.style.height,10),"getComputedStyle"in window?(style=window.getComputedStyle(ta),width=ta.getBoundingClientRect().width,$.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(i,val){width-=parseInt(style[val],10)}),mirror.style.width=width+"px"):mirror.style.width=Math.max($ta.width(),0)+"px",mirror.scrollTop=0,mirror.scrollTop=9e4,height=mirror.scrollTop,maxHeight&&height>maxHeight?(ta.style.overflowY="scroll",height=maxHeight):(ta.style.overflowY="hidden",minHeight>height&&(height=minHeight)),height+=boxOffset,original!==height&&(ta.style.height=height+"px",callback&&options.callback.call(ta,ta))}function resize(){clearTimeout(timeout),timeout=setTimeout(function(){$ta.width()!==width&&adjust()},parseInt(options.resizeDelay,10))}var maxHeight,minHeight,timeout,ta=this,$ta=$(ta),boxOffset=0,callback=$.isFunction(options.callback),originalStyles={height:ta.style.height,overflow:ta.style.overflow,overflowY:ta.style.overflowY,wordWrap:ta.style.wordWrap,resize:ta.style.resize},width=$ta.width();$ta.data("autosize")||($ta.data("autosize",!0),("border-box"===$ta.css("box-sizing")||"border-box"===$ta.css("-moz-box-sizing")||"border-box"===$ta.css("-webkit-box-sizing"))&&(boxOffset=$ta.outerHeight()-$ta.height()),minHeight=Math.max(parseInt($ta.css("minHeight"),10)-boxOffset||0,$ta.height()),$ta.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===$ta.css("resize")||"vertical"===$ta.css("resize")?"none":"horizontal"}),"onpropertychange"in ta?"oninput"in ta?$ta.on("input.autosize keyup.autosize",adjust):$ta.on("propertychange.autosize",function(){"value"===event.propertyName&&adjust()}):$ta.on("input.autosize",adjust),options.resizeDelay!==!1&&$(window).on("resize.autosize",resize),$ta.on("autosize.resize",adjust),$ta.on("autosize.resizeIncludeStyle",function(){mirrored=null,adjust()}),$ta.on("autosize.destroy",function(){mirrored=null,clearTimeout(timeout),$(window).off("resize",resize),$ta.off("autosize").off(".autosize").css(originalStyles).removeData("autosize")}),adjust())})}});
\ No newline at end of file
diff --git a/jquery.autosize.js b/jquery.autosize.js
index 50c5b7e..5b50087 100644
--- a/jquery.autosize.js
+++ b/jquery.autosize.js
@@ -4,239 +4,239 @@
(c) 2013 Jack Moore - http://www.jacklmoore.com/autosize
license: http://www.opensource.org/licenses/mit-license.php
*/
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD. Register as an anonymous module.
- define('jquery-autosize', ['jquery'], factory);
- } else {
- // Browser globals: jQuery or jQuery-like library, such as Zepto
- factory(window.jQuery || window.$);
- }
-}(function ($) {
- var
- defaults = {
- className: 'autosizejs',
- append: '',
- callback: false,
- resizeDelay: 10
- },
-
- // border:0 is unnecessary, but avoids a bug in FireFox on OSX
- copy = '',
-
- // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
- typographyStyles = [
- 'fontFamily',
- 'fontSize',
- 'fontWeight',
- 'fontStyle',
- 'letterSpacing',
- 'textTransform',
- 'wordSpacing',
- 'textIndent'
- ],
-
- // to keep track which textarea is being mirrored when adjust() is called.
- mirrored,
-
- // the mirror element, which is used to calculate what size the mirrored element should be.
- mirror = $(copy).data('autosize', true)[0];
-
- // test that line-height can be accurately copied.
- mirror.style.lineHeight = '99px';
- if ($(mirror).css('lineHeight') === '99px') {
- typographyStyles.push('lineHeight');
- }
- mirror.style.lineHeight = '';
-
- $.fn.autosize = function (options) {
- options = $.extend({}, defaults, options || {});
-
- if (mirror.parentNode !== document.body) {
- $(document.body).append(mirror);
- }
-
- return this.each(function () {
- var
- ta = this,
- $ta = $(ta),
- maxHeight,
- minHeight,
- boxOffset = 0,
- callback = $.isFunction(options.callback),
- originalStyles = {
- height: ta.style.height,
- overflow: ta.style.overflow,
- overflowY: ta.style.overflowY,
- wordWrap: ta.style.wordWrap,
- resize: ta.style.resize
- },
- timeout,
- width = $ta.width();
-
- if ($ta.data('autosize')) {
- // exit if autosize has already been applied, or if the textarea is the mirror element.
- return;
- }
- $ta.data('autosize', true);
-
- if ($ta.css('box-sizing') === 'border-box' || $ta.css('-moz-box-sizing') === 'border-box' || $ta.css('-webkit-box-sizing') === 'border-box'){
- boxOffset = $ta.outerHeight() - $ta.height();
- }
-
- // IE8 and lower return 'auto', which parses to NaN, if no min-height is set.
- minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset || 0, $ta.height());
-
- $ta.css({
- overflow: 'hidden',
- overflowY: 'hidden',
- wordWrap: 'break-word', // horizontal overflow is hidden, so break-word is necessary for handling words longer than the textarea width
- resize: ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal'
- });
-
- function initMirror() {
- var styles = {}, ignore;
-
- mirrored = ta;
- mirror.className = options.className;
- maxHeight = parseInt($ta.css('maxHeight'), 10);
-
- // mirror is a duplicate textarea located off-screen that
- // is automatically updated to contain the same text as the
- // original textarea. mirror always has a height of 0.
- // This gives a cross-browser supported way getting the actual
- // height of the text, through the scrollTop property.
- $.each(typographyStyles, function(i,val){
- styles[val] = $ta.css(val);
- });
- $(mirror).css(styles);
-
- // The textarea overflow is probably now hidden, but Chrome doesn't reflow the text to account for the
- // new space made available by removing the scrollbars. This workaround causes Chrome to reflow the text.
- if ('oninput' in ta) {
- var width = ta.style.width;
- ta.style.width = '0px';
- ignore = ta.offsetWidth; // This value isn't used, but getting it triggers the necessary reflow
- ta.style.width = width;
- }
- }
-
- // Using mainly bare JS in this function because it is going
- // to fire very often while typing, and needs to very efficient.
- function adjust() {
- var height, original, width, style;
-
- if (mirrored !== ta) {
- initMirror();
- }
-
- mirror.value = ta.value + options.append;
- mirror.style.overflowY = ta.style.overflowY;
- original = parseInt(ta.style.height,10);
-
- // window.getComputedStyle, getBoundingClientRect returning a width are unsupported in IE8 and lower.
- // The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value.
- if ('getComputedStyle' in window) {
- style = window.getComputedStyle(ta);
- width = ta.getBoundingClientRect().width;
-
- $.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
- width -= parseInt(style[val],10);
- });
-
- mirror.style.width = width + 'px';
- }
- else {
- mirror.style.width = Math.max($ta.width(), 0) + 'px';
- }
-
- // Needed for IE8 and lower to reliably return the correct scrollTop
- mirror.scrollTop = 0;
-
- mirror.scrollTop = 9e4;
-
- // Using scrollTop rather than scrollHeight because scrollHeight is non-standard and includes padding.
- height = mirror.scrollTop;
-
- if (maxHeight && height > maxHeight) {
- ta.style.overflowY = 'scroll';
- height = maxHeight;
- } else {
- ta.style.overflowY = 'hidden';
- if (height < minHeight) {
- height = minHeight;
- }
- }
-
- height += boxOffset;
-
- if (original !== height) {
- ta.style.height = height + 'px';
- if (callback) {
- options.callback.call(ta,ta);
- }
- }
- }
-
- function resize () {
- clearTimeout(timeout);
- timeout = setTimeout(function(){
- if ($ta.width() !== width) {
- adjust();
- }
- }, parseInt(options.resizeDelay,10));
- }
-
- if ('onpropertychange' in ta) {
- if ('oninput' in ta) {
- // Detects IE9. IE9 does not fire onpropertychange or oninput for deletions,
- // so binding to onkeyup to catch most of those occasions. There is no way that I
- // know of to detect something like 'cut' in IE9.
- $ta.on('input.autosize keyup.autosize', adjust);
- } else {
- // IE7 / IE8
- $ta.on('propertychange.autosize', function(){
- if(event.propertyName === 'value'){
- adjust();
- }
- });
- }
- } else {
- // Modern Browsers
- $ta.on('input.autosize', adjust);
- }
-
- // Set options.resizeDelay to false if using fixed-width textarea elements.
- // Uses a timeout and width check to reduce the amount of times adjust needs to be called after window resize.
-
- if (options.resizeDelay !== false) {
- $(window).on('resize.autosize', resize);
- }
-
- // Event for manual triggering if needed.
- // Should only be needed when the value of the textarea is changed through JavaScript rather than user input.
- $ta.on('autosize.resize', adjust);
-
- // Event for manual triggering that also forces the styles to update as well.
- // Should only be needed if one of typography styles of the textarea change, and the textarea is already the target of the adjust method.
- $ta.on('autosize.resizeIncludeStyle', function() {
- mirrored = null;
- adjust();
- });
-
- $ta.on('autosize.destroy', function(){
- mirrored = null;
- clearTimeout(timeout);
- $(window).off('resize', resize);
- $ta
- .off('autosize')
- .off('.autosize')
- .css(originalStyles)
- .removeData('autosize');
- });
-
- // Call adjust in case the textarea already contains text.
- adjust();
- });
- };
-}));
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else {
+ // Browser globals: jQuery or jQuery-like library, such as Zepto
+ factory(window.jQuery || window.$);
+ }
+}(function ($) {
+ var
+ defaults = {
+ className: 'autosizejs',
+ append: '',
+ callback: false,
+ resizeDelay: 10
+ },
+
+ // border:0 is unnecessary, but avoids a bug in FireFox on OSX
+ copy = '',
+
+ // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
+ typographyStyles = [
+ 'fontFamily',
+ 'fontSize',
+ 'fontWeight',
+ 'fontStyle',
+ 'letterSpacing',
+ 'textTransform',
+ 'wordSpacing',
+ 'textIndent'
+ ],
+
+ // to keep track which textarea is being mirrored when adjust() is called.
+ mirrored,
+
+ // the mirror element, which is used to calculate what size the mirrored element should be.
+ mirror = $(copy).data('autosize', true)[0];
+
+ // test that line-height can be accurately copied.
+ mirror.style.lineHeight = '99px';
+ if ($(mirror).css('lineHeight') === '99px') {
+ typographyStyles.push('lineHeight');
+ }
+ mirror.style.lineHeight = '';
+
+ $.fn.autosize = function (options) {
+ options = $.extend({}, defaults, options || {});
+
+ if (mirror.parentNode !== document.body) {
+ $(document.body).append(mirror);
+ }
+
+ return this.each(function () {
+ var
+ ta = this,
+ $ta = $(ta),
+ maxHeight,
+ minHeight,
+ boxOffset = 0,
+ callback = $.isFunction(options.callback),
+ originalStyles = {
+ height: ta.style.height,
+ overflow: ta.style.overflow,
+ overflowY: ta.style.overflowY,
+ wordWrap: ta.style.wordWrap,
+ resize: ta.style.resize
+ },
+ timeout,
+ width = $ta.width();
+
+ if ($ta.data('autosize')) {
+ // exit if autosize has already been applied, or if the textarea is the mirror element.
+ return;
+ }
+ $ta.data('autosize', true);
+
+ if ($ta.css('box-sizing') === 'border-box' || $ta.css('-moz-box-sizing') === 'border-box' || $ta.css('-webkit-box-sizing') === 'border-box'){
+ boxOffset = $ta.outerHeight() - $ta.height();
+ }
+
+ // IE8 and lower return 'auto', which parses to NaN, if no min-height is set.
+ minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset || 0, $ta.height());
+
+ $ta.css({
+ overflow: 'hidden',
+ overflowY: 'hidden',
+ wordWrap: 'break-word', // horizontal overflow is hidden, so break-word is necessary for handling words longer than the textarea width
+ resize: ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal'
+ });
+
+ function initMirror() {
+ var styles = {}, ignore;
+
+ mirrored = ta;
+ mirror.className = options.className;
+ maxHeight = parseInt($ta.css('maxHeight'), 10);
+
+ // mirror is a duplicate textarea located off-screen that
+ // is automatically updated to contain the same text as the
+ // original textarea. mirror always has a height of 0.
+ // This gives a cross-browser supported way getting the actual
+ // height of the text, through the scrollTop property.
+ $.each(typographyStyles, function(i,val){
+ styles[val] = $ta.css(val);
+ });
+ $(mirror).css(styles);
+
+ // The textarea overflow is probably now hidden, but Chrome doesn't reflow the text to account for the
+ // new space made available by removing the scrollbars. This workaround causes Chrome to reflow the text.
+ if ('oninput' in ta) {
+ var width = ta.style.width;
+ ta.style.width = '0px';
+ ignore = ta.offsetWidth; // This value isn't used, but getting it triggers the necessary reflow
+ ta.style.width = width;
+ }
+ }
+
+ // Using mainly bare JS in this function because it is going
+ // to fire very often while typing, and needs to very efficient.
+ function adjust() {
+ var height, original, width, style;
+
+ if (mirrored !== ta) {
+ initMirror();
+ }
+
+ mirror.value = ta.value + options.append;
+ mirror.style.overflowY = ta.style.overflowY;
+ original = parseInt(ta.style.height,10);
+
+ // window.getComputedStyle, getBoundingClientRect returning a width are unsupported in IE8 and lower.
+ // The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value.
+ if ('getComputedStyle' in window) {
+ style = window.getComputedStyle(ta);
+ width = ta.getBoundingClientRect().width;
+
+ $.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
+ width -= parseInt(style[val],10);
+ });
+
+ mirror.style.width = width + 'px';
+ }
+ else {
+ mirror.style.width = Math.max($ta.width(), 0) + 'px';
+ }
+
+ // Needed for IE8 and lower to reliably return the correct scrollTop
+ mirror.scrollTop = 0;
+
+ mirror.scrollTop = 9e4;
+
+ // Using scrollTop rather than scrollHeight because scrollHeight is non-standard and includes padding.
+ height = mirror.scrollTop;
+
+ if (maxHeight && height > maxHeight) {
+ ta.style.overflowY = 'scroll';
+ height = maxHeight;
+ } else {
+ ta.style.overflowY = 'hidden';
+ if (height < minHeight) {
+ height = minHeight;
+ }
+ }
+
+ height += boxOffset;
+
+ if (original !== height) {
+ ta.style.height = height + 'px';
+ if (callback) {
+ options.callback.call(ta,ta);
+ }
+ }
+ }
+
+ function resize () {
+ clearTimeout(timeout);
+ timeout = setTimeout(function(){
+ if ($ta.width() !== width) {
+ adjust();
+ }
+ }, parseInt(options.resizeDelay,10));
+ }
+
+ if ('onpropertychange' in ta) {
+ if ('oninput' in ta) {
+ // Detects IE9. IE9 does not fire onpropertychange or oninput for deletions,
+ // so binding to onkeyup to catch most of those occasions. There is no way that I
+ // know of to detect something like 'cut' in IE9.
+ $ta.on('input.autosize keyup.autosize', adjust);
+ } else {
+ // IE7 / IE8
+ $ta.on('propertychange.autosize', function(){
+ if(event.propertyName === 'value'){
+ adjust();
+ }
+ });
+ }
+ } else {
+ // Modern Browsers
+ $ta.on('input.autosize', adjust);
+ }
+
+ // Set options.resizeDelay to false if using fixed-width textarea elements.
+ // Uses a timeout and width check to reduce the amount of times adjust needs to be called after window resize.
+
+ if (options.resizeDelay !== false) {
+ $(window).on('resize.autosize', resize);
+ }
+
+ // Event for manual triggering if needed.
+ // Should only be needed when the value of the textarea is changed through JavaScript rather than user input.
+ $ta.on('autosize.resize', adjust);
+
+ // Event for manual triggering that also forces the styles to update as well.
+ // Should only be needed if one of typography styles of the textarea change, and the textarea is already the target of the adjust method.
+ $ta.on('autosize.resizeIncludeStyle', function() {
+ mirrored = null;
+ adjust();
+ });
+
+ $ta.on('autosize.destroy', function(){
+ mirrored = null;
+ clearTimeout(timeout);
+ $(window).off('resize', resize);
+ $ta
+ .off('autosize')
+ .off('.autosize')
+ .css(originalStyles)
+ .removeData('autosize');
+ });
+
+ // Call adjust in case the textarea already contains text.
+ adjust();
+ });
+ };
+}));