]> source.dussan.org Git - sonarqube.git/commitdiff
New Issues Page: simply display source file in the central panel when an issue is...
authorStas Vilchik <vilchiks@gmail.com>
Mon, 13 Jan 2014 11:38:38 +0000 (17:38 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 13 Jan 2014 11:38:38 +0000 (17:38 +0600)
sonar-server/src/main/webapp/javascripts/navigator/issues.js

index 31203cafda74c90c1a665d9b017a738195cf96cd..6aa130bf3b30192f8f45a8c55a05fbc673d9253f 100644 (file)
@@ -49,9 +49,9 @@ jQuery(function() {
 
 
     showDetails: function() {
-      var projectKey = this.model.get('component').key,
+      var componentKey = this.model.get('component').key,
           issueKey = this.model.get('key'),
-          url = baseUrl + '/resource/index/' + projectKey + '?metric=violations&display_title=true',
+          url = baseUrl + '/resource/index/' + componentKey + '?&display_title=true&tab=issues',
           details = jQuery('.navigator-details');
 
       function collapseIssues() {
@@ -62,14 +62,18 @@ jQuery(function() {
 
       this.$el.parent().children().removeClass('active');
       this.$el.addClass('active');
-      details.empty().addClass('loading');
-      jQuery.ajax({
-        type: 'GET',
-        url: url
-      }).done(function(r) {
-            details.html(r).removeClass('loading');
-            collapseIssues();
-          });
+
+      if (this.options.issuesView.componentKey !== componentKey) {
+        this.options.issuesView.componentKey = componentKey;
+        details.empty().addClass('loading');
+        jQuery.ajax({
+          type: 'GET',
+          url: url
+        }).done(function(r) {
+              details.html(r).removeClass('loading');
+              collapseIssues();
+            });
+      }
     }
   });
 
@@ -88,6 +92,11 @@ jQuery(function() {
     emptyView: NoIssuesView,
 
 
+    itemViewOptions: function() {
+      return { issuesView: this };
+    },
+
+
     onRender: function() {
       var $scrollEl = jQuery('.navigator-results'),
           scrollEl = $scrollEl.get(0),