aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-06-18 13:16:13 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-06-18 13:16:13 +0600
commit5ab7e1b9330fabb4db98806cd0aca5684e6ea200 (patch)
treec47c557a5f92ba716739d8ec22dd7528f4f36097
parentdb4984bb8106c87c602cf07ae6f8a5f34ca481bf (diff)
downloadsonarqube-5ab7e1b9330fabb4db98806cd0aca5684e6ea200.tar.gz
sonarqube-5ab7e1b9330fabb4db98806cd0aca5684e6ea200.zip
SONAR-5209 Highlight line over cursor
-rw-r--r--sonar-server/src/main/coffee/component-viewer/source.coffee8
-rw-r--r--sonar-server/src/main/less/component-viewer.less11
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 {