Przeglądaj źródła

Avoid shrinking the expandable text area.

Paulo Reis 9 lat temu
rodzic
commit
1a1320b561

+ 5 - 5
services/web/public/coffee/directives/expandableTextArea.coffee

@@ -5,12 +5,12 @@ define [
 		restrict: "A"
 		restrict: "A"
 		link: (scope, el) ->
 		link: (scope, el) ->
 			resetHeight = () ->
 			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
 			scope.$watch (() -> el.val()), resetHeight
 
 
-			resetHeight()
-
-
 	
 	

+ 1 - 0
services/web/public/stylesheets/app/editor/review-panel.less

@@ -451,6 +451,7 @@
 		resize: vertical;
 		resize: vertical;
 		color: @rp-type-darkgrey;
 		color: @rp-type-darkgrey;
 		margin-top: 3px;
 		margin-top: 3px;
+		overflow-x: hidden;
 	}
 	}
 
 
 .rp-icon-delete {
 .rp-icon-delete {