Skip to content

Commit

Permalink
Adding to plugins.jquery.com
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmoore committed Jan 17, 2013
1 parent 51c32e0 commit b209bfc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
24 changes: 24 additions & 0 deletions autosize.jquery.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "autosize",
"title": "Autosize",
"description": "enables automatic height for textarea elements",
"keywords": [
"form",
"textarea",
"ui"
],
"version": "1.15.0",
"author": {
"name": "Jack Moore",
"url": "http://www.jacklmoore.com"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"homepage": "http://jacklmoore.com/autosize",
"demo": "http://jacklmoore.com/autosize",
"dependencies": { "jquery": ">=1.4" }
}
6 changes: 3 additions & 3 deletions jquery.autosize.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
return;
}

minHeight = parseInt($ta.css('minHeight'), 10);
minHeight = minHeight || $ta.height();
minHeight = parseInt($ta.css('minHeight'), 10) || $ta.height();

if ($ta.css('box-sizing') === borderBox || $ta.css('-moz-box-sizing') === borderBox || $ta.css('-webkit-box-sizing') === borderBox){
boxOffset = $ta.outerHeight() - $ta.height();
Expand Down Expand Up @@ -113,7 +112,8 @@
original = parseInt(ta.style.height,10);

// Update the width in case the original textarea width has changed
mirror.style.width = ($ta.width() < 0 ? 0 : $ta.width()) + 'px';
// A floor of 0 is needed because IE8 returns a negative value for hidden textareas, raising an error.
mirror.style.width = Math.max($ta.width(), 0) + 'px';

// The following three lines can be replaced with `height = mirror.scrollHeight` when dropping IE7 support.
mirror.scrollTop = 0;
Expand Down

0 comments on commit b209bfc

Please sign in to comment.