diff --git a/services/web/app/views/project/editor/review-panel.jade b/services/web/app/views/project/editor/review-panel.jade index 4ad558ef90..91c2b84c41 100644 --- a/services/web/app/views/project/editor/review-panel.jade +++ b/services/web/app/views/project/editor/review-panel.jade @@ -6,7 +6,7 @@ docs="docs" on-open="refreshResolvedCommentsDropdown();" on-unresolve="unresolveComment(threadId);" - on-delete="deleteComment(entryId);" + on-delete="deleteComment(entryId, threadId);" is-loading="reviewPanel.dropdown.loading" ) span.review-panel-toolbar-label(ng-click="editor.wantTrackChanges = true;", ng-if="editor.wantTrackChanges === false") Track Changes is @@ -210,7 +210,7 @@ script(type='text/ng-template', id='resolvedCommentEntryTemplate') |  Re-open a.rp-entry-button( href - ng-click="onDelete({ 'entryId': entryId });" + ng-click="onDelete({ 'entryId': entryId, 'threadId': threadId });" ) |  Delete @@ -278,6 +278,6 @@ script(type='text/ng-template', id='resolvedCommentsDropdownTemplate') thread="thread" doc="doc" on-unresolve="handleUnresolve(threadId);" - on-delete="handleDelete(entryId);" + on-delete="handleDelete(entryId, threadId);" ) 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 a42915e648..52825ba5e8 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -66,7 +66,7 @@ define [ $scope.reviewPanelEventsBridge.on "aceScrollbarVisibilityChanged", (isVisible, scrollbarWidth) -> scrollbar = {isVisible, scrollbarWidth} updateScrollbar() - + updateScrollbar = () -> if scrollbar.isVisible and $scope.reviewPanel.subView == $scope.SubViews.CUR_FILE $reviewPanelEl.css "right", "#{ scrollbar.scrollbarWidth }px" @@ -231,9 +231,6 @@ define [ $scope.$broadcast "review-panel:recalculate-screen-positions" $scope.$broadcast "review-panel:layout" - $scope.$on "comment:removed", (comment) -> - console.log comment - $scope.acceptChange = (entry_id) -> $http.post "/project/#{$scope.project_id}/doc/#{$scope.editor.open_doc_id}/changes/#{entry_id}/accept", {_csrf: window.csrfToken} $scope.$broadcast "change:accept", entry_id @@ -283,7 +280,6 @@ define [ $scope.$broadcast "review-panel:layout" $scope.resolveComment = (entry, entry_id) -> - entry.showWhenResolved = false entry.focused = false $http.post "/project/#{$scope.project_id}/thread/#{entry.thread_id}/resolve", {_csrf: window.csrfToken} _onCommentResolved(entry.thread_id, ide.$scope.user) @@ -305,20 +301,15 @@ define [ delete thread.resolved_by_user delete thread.resolved_at $scope.$broadcast "comment:unresolve_thread", thread_id + + _onCommentDeleted = (thread_id) -> + delete $scope.reviewPanel.commentThreads[thread_id] - $scope.deleteComment = (entry_id) -> + $scope.deleteComment = (entry_id, thread_id) -> + console.log thread_id + _onCommentDeleted(thread_id) $scope.$broadcast "comment:remove", entry_id - $scope.showThread = (entry) -> - entry.showWhenResolved = true - $timeout () -> - $scope.$broadcast "review-panel:layout" - - $scope.hideThread = (entry) -> - entry.showWhenResolved = false - $timeout () -> - $scope.$broadcast "review-panel:layout" - $scope.setSubView = (subView) -> $scope.reviewPanel.subView = subView diff --git a/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee b/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee index df7302d1d1..a440be0585 100644 --- a/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee +++ b/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee @@ -29,8 +29,8 @@ define [ scope.onUnresolve({ threadId }) filterResolvedComments() - scope.handleDelete = (entryId) -> - scope.onDelete({ entryId }) + scope.handleDelete = (entryId, threadId) -> + scope.onDelete({ entryId, threadId }) filterResolvedComments()