]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3762 Provide a new Histogram widget to display a measure filter
authorStas Vilchik <vilchiks@gmail.com>
Tue, 17 Dec 2013 06:41:06 +0000 (12:41 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 17 Dec 2013 06:41:06 +0000 (12:41 +0600)
Show resource in the same window
Open correct tab for files

sonar-server/src/main/webapp/javascripts/widgets/histogram.js

index 5398854750c75f39923b7401ec6668d828332373..00a68e213666eecbabd7b9a64bc9a0b8eaa8d544 100644 (file)
@@ -274,7 +274,15 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets;
         })
         .on('mouseleave', leaveHandler)
         .on('click', function(d) {
-          window.open(widget.options().baseUrl + encodeURIComponent(d.key));
+          switch (d.data.qualifier) {
+            case 'CLA':
+            case 'FIL':
+              window.location = widget.options().baseUrl + encodeURIComponent(d.key) +
+                  '?metric=' + encodeURIComponent(widget.mainMetric);
+              break;
+            default:
+              window.location = widget.options().baseUrl + encodeURIComponent(d.key);
+          }
         });
   };