From 4d15fc30baa744c979cfec2db729d677bcfba26c Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 17 Jan 2017 16:55:18 +0100 Subject: [PATCH] Don't flash resolved comments when editor is loading --- services/web/app/views/project/editor/editor.jade | 3 ++- services/web/app/views/project/editor/review-panel.jade | 1 + services/web/public/coffee/ide.coffee | 2 +- .../review-panel/controllers/ReviewPanelController.coffee | 3 +++ services/web/public/stylesheets/app/editor/review-panel.less | 5 ++++- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/services/web/app/views/project/editor/editor.jade b/services/web/app/views/project/editor/editor.jade index f57eb4dd2a..935ce8bb28 100644 --- a/services/web/app/views/project/editor/editor.jade +++ b/services/web/app/views/project/editor/editor.jade @@ -18,7 +18,8 @@ div.full-size( 'rp-state-overview': (reviewPanel.subView === SubViews.OVERVIEW),\ 'rp-size-mini': (!ui.reviewPanelOpen && reviewPanel.hasEntries),\ 'rp-size-expanded': ui.reviewPanelOpen,\ - 'rp-layout-left': reviewPanel.layoutToLeft\ + 'rp-layout-left': reviewPanel.layoutToLeft,\ + 'rp-loading-threads': reviewPanel.loadingThreads\ }" ) .loading-panel(ng-show="!editor.sharejs_doc || editor.opening") diff --git a/services/web/app/views/project/editor/review-panel.jade b/services/web/app/views/project/editor/review-panel.jade index 7982a5f991..95e54368c9 100644 --- a/services/web/app/views/project/editor/review-panel.jade +++ b/services/web/app/views/project/editor/review-panel.jade @@ -52,6 +52,7 @@ on-reply="submitReply(entry, entry_id);" on-indicator-click="toggleReviewPanel();" permissions="permissions" + ng-if="!reviewPanel.loadingThreads" ) div(ng-if="entry.type === 'add-comment' && permissions.comment") diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 9baaf1c66f..b17b9b05f4 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -67,7 +67,7 @@ define [ view: "editor" chatOpen: false pdfLayout: 'sideBySide' - reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}") and $scope.project.features.trackChanges + reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}") showCodeCheckerOnboarding: !window.userSettings.syntaxValidation? } $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 717513e884..d00e7078aa 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -25,6 +25,7 @@ define [ resolvedThreadIds: {} layoutToLeft: false rendererData: {} + loadingThreads: false $scope.$on "layout:pdf:linked", (event, state) -> $scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed) @@ -403,8 +404,10 @@ define [ # We get any updates in real time so only need to load them once. return _threadsLoaded = true + $scope.reviewPanel.loadingThreads = true $http.get "/project/#{$scope.project_id}/threads" .success (threads) -> + $scope.reviewPanel.loadingThreads = false for thread_id, _ of $scope.reviewPanel.resolvedThreadIds delete $scope.reviewPanel.resolvedThreadIds[thread_id] for thread_id, thread of threads diff --git a/services/web/public/stylesheets/app/editor/review-panel.less b/services/web/public/stylesheets/app/editor/review-panel.less index c65e0e8240..511c9b25b1 100644 --- a/services/web/public/stylesheets/app/editor/review-panel.less +++ b/services/web/public/stylesheets/app/editor/review-panel.less @@ -692,7 +692,7 @@ .track-changes-marker-callout { border-radius: 0; position: absolute; - .rp-state-overview & { + .rp-state-overview &, .rp-loading-threads & { display: none; } } @@ -709,6 +709,9 @@ .track-changes-marker { border-radius: 0; position: absolute; + .rp-loading-threads & { + display: none; + } } .track-changes-comment-marker {