Skip to content

Commit

Permalink
Merge pull request #2 from CodingAspect/auto-resize-onload
Browse files Browse the repository at this point in the history
Auto resize onload
  • Loading branch information
codingAspect committed Mar 16, 2016
2 parents ab2965d + 8673107 commit 24a9500
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions angular-autogrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
$scope.maxAllowedHeight = ($scope.lineHeight * $scope.attrs.maxLines) - $scope.offset;

$element[0].addEventListener('input', $scope.autogrowFn);

/**
* Auto-resize when there's content on page load
*/
if($element[0].value != ''){
$scope.autogrowFn();
}
}
}
}]);
Expand Down
2 changes: 1 addition & 1 deletion angular-autogrow.min.js

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

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-autogrow",
"main": "angular-autogrow.min.js",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/CodingAspect/Angular-Autogrow",
"authors": [
"Evyatar Rosner <[email protected]>"
Expand Down

0 comments on commit 24a9500

Please sign in to comment.