1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-14 04:55:31 +00:00

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
services/web/public/coffee
directives
ide/review-panel/controllers

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