Merge pull request #496 from sharelatex/pr-review-panel-relayout

Review panel relayout
This commit is contained in:
Paulo Jorge Reis 2017-05-12 13:54:59 +01:00 committed by GitHub
commit d550ede112
3 changed files with 12 additions and 8 deletions

View file

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

View file

@ -70,6 +70,7 @@ define [
chatOpen: false
pdfLayout: 'sideBySide'
reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}")
miniReviewPanelVisible: false
}
$scope.user = window.user

View file

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