diff --git a/services/web/app/views/project/editor/editor.pug b/services/web/app/views/project/editor/editor.pug index 6c062f3cbe..e8217a9319 100644 --- a/services/web/app/views/project/editor/editor.pug +++ b/services/web/app/views/project/editor/editor.pug @@ -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,\ diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 9fbbfe9937..dabf166578 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -70,6 +70,7 @@ define [ chatOpen: false pdfLayout: 'sideBySide' reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}") + miniReviewPanelVisible: false } $scope.user = window.user diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index bf3f96ffc3..cb17d53e04 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -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()