Emit event when textarea resizes; capture it in the review panel and trigger reflow.

This commit is contained in:
Paulo Reis
2017-01-26 14:35:01 +00:00
parent 6304c213bd
commit ce89714a48
2 changed files with 5 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ define [
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

View File

@@ -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")