|
|
@@ -5,12 +5,12 @@ define [
|
|
|
restrict: "A"
|
|
|
link: (scope, el) ->
|
|
|
resetHeight = () ->
|
|
|
- el.css("height", "auto")
|
|
|
- el.css("height", el.prop("scrollHeight"))
|
|
|
+ curHeight = el.outerHeight()
|
|
|
+ fitHeight = el.prop("scrollHeight")
|
|
|
+
|
|
|
+ if fitHeight > curHeight and el.val() != ""
|
|
|
+ el.css("height", fitHeight)
|
|
|
|
|
|
scope.$watch (() -> el.val()), resetHeight
|
|
|
|
|
|
- resetHeight()
|
|
|
-
|
|
|
-
|
|
|
|