Skip to content

Commit

Permalink
Resolve merge conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Martin committed Feb 24, 2016
2 parents cdbc841 + a243e1a commit ee37f39
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
4 changes: 2 additions & 2 deletions autogrow.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autogrow"
, "version": "1.0.2"
, "version": "1.0.3"
, "title": "autogrow.js"
, "author": {
"name": "Jason Edelman"
Expand All @@ -20,4 +20,4 @@
, "homepage": "https://github.com/ultimatedelman/autogrow"
, "docs": "https://github.com/ultimatedelman/autogrow"
, "demo": "http://jsfiddle.net/edelman/HrnHb/"
}
}
17 changes: 11 additions & 6 deletions autogrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
}
elem.css('height', min);

if (opts.onInitialize) {
resize.call(elem);
if (opts.onInitialize && elem.length) {
resize.call(elem[0]);
}
});
opts.context
.on('keyup paste', selector, resize)
;

function resize (e){
var box = $(this)
, oldHeight = box.innerHeight()
Expand All @@ -72,9 +72,12 @@
//doing this on an exact clone to figure out the height first and then applying it to the
//actual box makes it look cleaner to the user
clone = box.clone()
.addClass(opts.cloneClass) //add clone class for extra css rules
.css({position: 'absolute', zIndex:-10}) //make "invisible"
.val(box.val()) //populate with content for consistent measuring
//add clone class for extra css rules
.addClass(opts.cloneClass)
//make "invisible", remove height restriction potentially imposed by existing CSS
.css({position: 'absolute', zIndex:-10, height: ''})
//populate with content for consistent measuring
.val(box.val())
;
box.after(clone); //append as close to the box as possible for best CSS matching for clone
do { //reduce height until they don't match
Expand Down Expand Up @@ -112,5 +115,7 @@
function notifyShrunk() {
opts.context.trigger('autogrow:shrink');
}

return that;
}
})(jQuery);
4 changes: 2 additions & 2 deletions autogrow.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "autogrow",
"description": "Automatically grow and shrink textareas with the content as you type.",
"version": "1.0.4",
"main": "./autogrow.js",
"author": {
"name": "Jason Edelman",
"url": "http://jasonedelman.com"
},
"dependencies": {
"jquery": ">=1.7"
},
"keywords": ["textarea", "grow", "shrink", "resize"],
"homepage": "https://github.com/ultimatedelman/autogrow"
}

0 comments on commit ee37f39

Please sign in to comment.