diff --git a/services/web/public/coffee/directives/expandableTextArea.coffee b/services/web/public/coffee/directives/expandableTextArea.coffee index 8f646c10a7..d0bfa9cb99 100644 --- a/services/web/public/coffee/directives/expandableTextArea.coffee +++ b/services/web/public/coffee/directives/expandableTextArea.coffee @@ -5,12 +5,13 @@ 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() != "" + scope.$emit "expandable-text-area:resize" + el.css("height", fitHeight) scope.$watch (() -> el.val()), resetHeight - resetHeight() - - \ No newline at end of file diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index 40be0ed372..320952f746 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -33,6 +33,10 @@ define [ $scope.$on "layout:pdf:resize", (event, state) -> $scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed) + $scope.$on "expandable-text-area:resize", (event) -> + $timeout () -> + $scope.$broadcast "review-panel:layout" + $scope.$watch "ui.pdfLayout", (layout) -> $scope.reviewPanel.layoutToLeft = (layout == "flat") diff --git a/services/web/public/stylesheets/app/editor/review-panel.less b/services/web/public/stylesheets/app/editor/review-panel.less index da9fa7eb43..1bac7faf6f 100644 --- a/services/web/public/stylesheets/app/editor/review-panel.less +++ b/services/web/public/stylesheets/app/editor/review-panel.less @@ -451,6 +451,8 @@ resize: vertical; color: @rp-type-darkgrey; margin-top: 3px; + overflow-x: hidden; + min-height: 3em; } .rp-icon-delete {