]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5480 Make it possible to "un-choose" filters and selected line
authorStas Vilchik <vilchiks@gmail.com>
Mon, 28 Jul 2014 12:47:23 +0000 (14:47 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 28 Jul 2014 12:47:23 +0000 (14:47 +0200)
server/sonar-web/src/main/coffee/component-viewer/source.coffee

index c4a9b5c96198706262fe3d1ca03b0cda18dd21f9..f0c17c7a127b64f29c1c7fa14c70a5d0b4e30097 100644 (file)
@@ -155,11 +155,13 @@ define [
 
 
     highlightLine: (e) ->
-      @$(".#{HIGHLIGHTED_ROW_CLASS}").removeClass HIGHLIGHTED_ROW_CLASS
       row = $(e.currentTarget).closest('.row')
-      row.addClass HIGHLIGHTED_ROW_CLASS
-      @highlightedLine = row.data 'line-number'
-      @showLineActionsPopup(e) if @options.main.state.get 'canCreateManualIssue'
+      highlighted = row.is ".#{HIGHLIGHTED_ROW_CLASS}"
+      @$(".#{HIGHLIGHTED_ROW_CLASS}").removeClass HIGHLIGHTED_ROW_CLASS
+      unless highlighted
+        row.addClass HIGHLIGHTED_ROW_CLASS
+        @highlightedLine = row.data 'line-number'
+        @showLineActionsPopup(e)
 
 
     highlightCurrentLine: ->