From 27c48f3790df32bd3a99ba3225759d60e515adda Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 3 Feb 2017 14:17:09 +0100 Subject: [PATCH] Clear selection after creating a comment --- .../aceEditor/cursor-position/CursorPositionManager.coffee | 3 +++ .../ide/review-panel/controllers/ReviewPanelController.coffee | 1 + 2 files changed, 4 insertions(+) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee index b8a3d43819..119aa471e1 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee @@ -37,6 +37,9 @@ define [ @gotoOffset(offset) , 10 # Hack: Must happen after @gotoStoredPosition + @$scope.$on "#{@$scope.name}:clearSelection", (e) => + @editor.selection.clearSelection() + storeScrollTopPosition: (session) -> if @doc_id? docPosition = @localStorage("doc.position.#{@doc_id}") || {} 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 ac687386f8..40be0ed372 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -306,6 +306,7 @@ define [ $http.post("/project/#{$scope.project_id}/thread/#{thread_id}/messages", {content, _csrf: window.csrfToken}) .error (error) -> ide.showGenericMessageModal("Error submitting comment", "Sorry, there was a problem submitting your comment") + $scope.$broadcast "editor:clearSelection" $timeout () -> $scope.$broadcast "review-panel:layout" event_tracking.sendMB "rp-new-comment", { size: content.length }