Hide review panel when there are no entries.

This commit is contained in:
Paulo Reis 2016-11-15 15:04:29 +00:00
parent d0f451df2e
commit 7bf55823b2
4 changed files with 24 additions and 3 deletions

View file

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

View file

@ -7,6 +7,7 @@ define [
$scope.reviewPanel =
entries: {}
trackNewChanges: false
hasEntries: false
$scope.commentState =
adding: false
@ -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

View file

@ -43,7 +43,6 @@
#editor {
.full-size;
right: @review-off-width;
}
.loading-screen {

View file

@ -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;
}