mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #496 from sharelatex/pr-review-panel-relayout
Review panel relayout
This commit is contained in:
commit
d550ede112
3 changed files with 12 additions and 8 deletions
|
@ -16,7 +16,7 @@ div.full-size(
|
|||
'rp-state-current-file-expanded': (reviewPanel.subView === SubViews.CUR_FILE && ui.reviewPanelOpen),\
|
||||
'rp-state-current-file-mini': (reviewPanel.subView === SubViews.CUR_FILE && !ui.reviewPanelOpen),\
|
||||
'rp-state-overview': (reviewPanel.subView === SubViews.OVERVIEW),\
|
||||
'rp-size-mini': (!ui.reviewPanelOpen && reviewPanel.hasEntries),\
|
||||
'rp-size-mini': ui.miniReviewPanelVisible,\
|
||||
'rp-size-expanded': ui.reviewPanelOpen,\
|
||||
'rp-layout-left': reviewPanel.layoutToLeft,\
|
||||
'rp-loading-threads': reviewPanel.loadingThreads,\
|
||||
|
|
|
@ -70,6 +70,7 @@ define [
|
|||
chatOpen: false
|
||||
pdfLayout: 'sideBySide'
|
||||
reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}")
|
||||
miniReviewPanelVisible: false
|
||||
}
|
||||
$scope.user = window.user
|
||||
|
||||
|
|
|
@ -126,6 +126,12 @@ define [
|
|||
else
|
||||
$reviewPanelEl.css "right", "0"
|
||||
|
||||
$scope.$watch "!ui.reviewPanelOpen && reviewPanel.hasEntries", (open, prevVal) ->
|
||||
return if !open?
|
||||
$scope.ui.miniReviewPanelVisible = open
|
||||
if open != prevVal
|
||||
$timeout () -> $scope.$broadcast "review-panel:toggle"
|
||||
|
||||
$scope.$watch "ui.reviewPanelOpen", (open) ->
|
||||
return if !open?
|
||||
if !open
|
||||
|
@ -135,7 +141,10 @@ define [
|
|||
else
|
||||
# Reset back to what we had when previously open
|
||||
$scope.reviewPanel.subView = $scope.reviewPanel.openSubView
|
||||
|
||||
$timeout () ->
|
||||
$scope.$broadcast "review-panel:toggle"
|
||||
$scope.$broadcast "review-panel:layout", false
|
||||
|
||||
$scope.$watch "reviewPanel.subView", (view) ->
|
||||
return if !view?
|
||||
updateScrollbar()
|
||||
|
@ -165,12 +174,6 @@ define [
|
|||
), (nEntries) ->
|
||||
$scope.reviewPanel.hasEntries = nEntries > 0 and $scope.project.features.trackChangesVisible
|
||||
|
||||
$scope.$watch "ui.reviewPanelOpen", (reviewPanelOpen) ->
|
||||
return if !reviewPanelOpen?
|
||||
$timeout () ->
|
||||
$scope.$broadcast "review-panel:toggle"
|
||||
$scope.$broadcast "review-panel:layout", false
|
||||
|
||||
regenerateTrackChangesId = (doc) ->
|
||||
old_id = getChangeTracker(doc.doc_id).getIdSeed()
|
||||
new_id = RangesTracker.generateIdSeed()
|
||||
|
|
Loading…
Reference in a new issue