mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:23:10 +00:00
Hide review panel when there are no entries.
This commit is contained in:
parent
d0f451df2e
commit
7bf55823b2
4 changed files with 24 additions and 3 deletions
|
@ -9,7 +9,7 @@ div.full-size(
|
|||
minimum-restore-size-east="300"
|
||||
allow-overflow-on="'center'"
|
||||
)
|
||||
.ui-layout-center(ng-controller="ReviewPanelController", ng-class="{'has-review-panel': ui.reviewPanelOpen}")
|
||||
.ui-layout-center(ng-controller="ReviewPanelController", ng-class="{'has-review-panel': ui.reviewPanelOpen, 'has-entries': reviewPanel.hasEntries }")
|
||||
.loading-panel(ng-show="!editor.sharejs_doc || editor.opening")
|
||||
span(ng-show="editor.open_doc_id")
|
||||
i.fa.fa-spin.fa-refresh
|
||||
|
|
|
@ -7,7 +7,8 @@ define [
|
|||
$scope.reviewPanel =
|
||||
entries: {}
|
||||
trackNewChanges: false
|
||||
|
||||
hasEntries: false
|
||||
|
||||
$scope.commentState =
|
||||
adding: false
|
||||
content: ""
|
||||
|
@ -51,6 +52,9 @@ define [
|
|||
scroller.off "scroll"
|
||||
$scope.onScroll = null
|
||||
|
||||
$scope.$watch (() -> Object.keys($scope.reviewPanel.entries).length), (nEntries) ->
|
||||
$scope.reviewPanel.hasEntries = nEntries > 0
|
||||
|
||||
# If we listen for scroll events in the review panel natively, then with a Mac trackpad
|
||||
# the scroll is very smooth (natively done I'd guess), but we don't get polled regularly
|
||||
# enough to keep Ace in step, and it noticeably lags. If instead, we borrow the manual
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
|
||||
#editor {
|
||||
.full-size;
|
||||
right: @review-off-width;
|
||||
}
|
||||
|
||||
.loading-screen {
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
}
|
||||
|
||||
#review-panel {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: @review-off-width;
|
||||
top: 0px;
|
||||
|
@ -366,6 +367,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
.has-entries {
|
||||
#editor {
|
||||
right: @review-off-width;
|
||||
.ace-editor-body {
|
||||
overflow: visible;
|
||||
.ace_scrollbar-v {
|
||||
right: -@review-off-width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#review-panel {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.has-review-panel {
|
||||
#editor {
|
||||
right: @review-panel-width;
|
||||
|
@ -384,6 +401,7 @@
|
|||
}
|
||||
|
||||
#review-panel {
|
||||
display: block;
|
||||
width: @review-panel-width;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue