Skip to content

Commit

Permalink
Fixed minor min-height issue with border-box sizing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmoore committed Jan 20, 2013
1 parent 3050ca7 commit eec9a26
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion autosize.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"textarea",
"ui"
],
"version": "1.16.1",
"version": "1.16.2",
"author": {
"name": "Jack Moore",
"url": "http://www.jacklmoore.com"
Expand Down
4 changes: 2 additions & 2 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "jquery-autosize",
"version": "1.16.1",
"version": "1.16.2",
"main": "./jquery.autosize.js",
"dependencies": {
"jquery": ">=1.4.2"
"jquery": ">=1.4"
}
}
6 changes: 3 additions & 3 deletions jquery.autosize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autosize 1.16.1 - jQuery plugin for textareas
// Autosize 1.16.2 - jQuery plugin for textareas
// (c) 2013 Jack Moore - jacklmoore.com
// license: www.opensource.org/licenses/mit-license.php
(function ($) {
Expand Down Expand Up @@ -64,12 +64,12 @@
return;
}

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();
}

minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset, $ta.height());

resize = ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal';

$ta.css({
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Small jQuery plugin to allow dynamic resizing of textarea height, so that it gro

## Changelog

### Version 1.16 - 2013/1/20
* Minor fixes.

### Version 1.15 - November 16, 2012
* Reworked to only create a single mirror element, instead of one for each textarea.
* Dropped feature detection for FF3 and Safari 4.
Expand Down

0 comments on commit eec9a26

Please sign in to comment.