diff options
-rw-r--r-- | sonar-server/src/main/coffee/component-viewer/source.coffee | 8 | ||||
-rw-r--r-- | sonar-server/src/main/less/component-viewer.less | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sonar-server/src/main/coffee/component-viewer/source.coffee b/sonar-server/src/main/coffee/component-viewer/source.coffee index f1191c73532..ba33b45e391 100644 --- a/sonar-server/src/main/coffee/component-viewer/source.coffee +++ b/sonar-server/src/main/coffee/component-viewer/source.coffee @@ -29,11 +29,14 @@ define [ LINES_AROUND_ISSUE = 4 LINES_AROUND_COVERED_LINE = 1 EXPAND_LINES = 20 + HIGHLIGHTED_ROW_CLASS = 'row-highlighted' events: 'click .sym': 'highlightUsages' + 'click .lid': 'highlightLine' + 'click .coverage-tests': 'showCoveragePopup' 'click .duplication-exists': 'showDuplicationPopup' @@ -111,6 +114,11 @@ define [ @$el.html '<div style="padding: 10px;"><i class="spinner"></i></div>' + highlightLine: (e) -> + @$(".#{HIGHLIGHTED_ROW_CLASS}").removeClass HIGHLIGHTED_ROW_CLASS + $(e.currentTarget).closest('.row').addClass HIGHLIGHTED_ROW_CLASS + + highlightUsages: (e) -> key = e.currentTarget.className.split(/\s+/)[0] @$('.sym.highlighted').removeClass 'highlighted' diff --git a/sonar-server/src/main/less/component-viewer.less b/sonar-server/src/main/less/component-viewer.less index bc4d3aacc4b..6cae4991a82 100644 --- a/sonar-server/src/main/less/component-viewer.less +++ b/sonar-server/src/main/less/component-viewer.less @@ -150,6 +150,16 @@ } } + .code .row:hover { + td.stat { background-color: @barBorderColor; } + td.line { background-color: @barBackgroundColor; } + } + + .code .row-highlighted { + td.stat { background-color: #e9e94d !important; } + td.line { background-color: #f1f1a3 !important; } + } + .code td.line { width: 100%; padding: 1px 5px; @@ -172,6 +182,7 @@ min-width: 18px; padding-left: 10px; padding-right: 10px; + cursor: pointer; } .code .coverage-tests { |