Просмотр исходного кода

Clear selection after creating a comment

James Allen 9 лет назад
Родитель
Сommit
4a80f0de5a

+ 3 - 0
services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee

@@ -37,6 +37,9 @@ define [
 						@gotoOffset(offset)
 						@gotoOffset(offset)
 					, 10 # Hack: Must happen after @gotoStoredPosition
 					, 10 # Hack: Must happen after @gotoStoredPosition
 
 
+			@$scope.$on "#{@$scope.name}:clearSelection", (e) =>
+				@editor.selection.clearSelection()
+
 		storeScrollTopPosition: (session) ->
 		storeScrollTopPosition: (session) ->
 			if @doc_id?
 			if @doc_id?
 				docPosition = @localStorage("doc.position.#{@doc_id}") || {}
 				docPosition = @localStorage("doc.position.#{@doc_id}") || {}

+ 1 - 0
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})
 			$http.post("/project/#{$scope.project_id}/thread/#{thread_id}/messages", {content, _csrf: window.csrfToken})
 				.error (error) ->
 				.error (error) ->
 					ide.showGenericMessageModal("Error submitting comment", "Sorry, there was a problem submitting your comment")
 					ide.showGenericMessageModal("Error submitting comment", "Sorry, there was a problem submitting your comment")
+			$scope.$broadcast "editor:clearSelection"
 			$timeout () ->
 			$timeout () ->
 				$scope.$broadcast "review-panel:layout"
 				$scope.$broadcast "review-panel:layout"
 			event_tracking.sendMB "rp-new-comment", { size: content.length }
 			event_tracking.sendMB "rp-new-comment", { size: content.length }