]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5718 Ressurrect usage highlighting
authorStas Vilchik <vilchiks@gmail.com>
Mon, 3 Nov 2014 15:37:55 +0000 (16:37 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 3 Nov 2014 15:48:57 +0000 (16:48 +0100)
server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee

index 4df69e47e9032d2d62f6afd617cb1c9f28a7a8e4..036088dde58c586d456d444bf941a2cd33b12ec3 100644 (file)
@@ -31,6 +31,7 @@ define [
 
     events:
       'click .js-close-component-viewer': 'closeComponentViewer'
+      'click .sym': 'highlightUsages'
 
 
     initialize: (options) ->
@@ -217,6 +218,13 @@ define [
       @options.app.controller.closeComponentViewer()
 
 
+    highlightUsages: (e) ->
+      highlighted = $(e.currentTarget).is '.highlighted'
+      key = e.currentTarget.className.split(/\s+/)[0]
+      @$('.sym.highlighted').removeClass 'highlighted'
+      @$(".sym.#{key}").addClass 'highlighted' unless highlighted
+
+
     serializeData: ->
       _.extend super,
         source: @source.get 'formattedSource'