mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #406 from sharelatex/pr-expandable-text-area-fixes
Expandable text area fixes
This commit is contained in:
commit
1b06af766d
3 changed files with 12 additions and 5 deletions
|
@ -5,12 +5,13 @@ define [
|
||||||
restrict: "A"
|
restrict: "A"
|
||||||
link: (scope, el) ->
|
link: (scope, el) ->
|
||||||
resetHeight = () ->
|
resetHeight = () ->
|
||||||
el.css("height", "auto")
|
curHeight = el.outerHeight()
|
||||||
el.css("height", el.prop("scrollHeight"))
|
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
|
scope.$watch (() -> el.val()), resetHeight
|
||||||
|
|
||||||
resetHeight()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@ define [
|
||||||
$scope.$on "layout:pdf:resize", (event, state) ->
|
$scope.$on "layout:pdf:resize", (event, state) ->
|
||||||
$scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed)
|
$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.$watch "ui.pdfLayout", (layout) ->
|
||||||
$scope.reviewPanel.layoutToLeft = (layout == "flat")
|
$scope.reviewPanel.layoutToLeft = (layout == "flat")
|
||||||
|
|
||||||
|
|
|
@ -451,6 +451,8 @@
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
color: @rp-type-darkgrey;
|
color: @rp-type-darkgrey;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
min-height: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rp-icon-delete {
|
.rp-icon-delete {
|
||||||
|
|
Loading…
Reference in a new issue