From 0399fbfe3896d6e47006616063e7c46070cba95f Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 2 Dec 2014 14:18:15 +0100 Subject: [PATCH] SONAR-5877 Integrate the duplications info --- .../src/main/js/source-viewer/viewer.js | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/server/sonar-web/src/main/js/source-viewer/viewer.js b/server/sonar-web/src/main/js/source-viewer/viewer.js index 036f3042ea7..f9a38e89427 100644 --- a/server/sonar-web/src/main/js/source-viewer/viewer.js +++ b/server/sonar-web/src/main/js/source-viewer/viewer.js @@ -74,7 +74,13 @@ define([ }, open: function (id, key) { - var that = this; + var that = this, + finalize = function () { + that.requestIssues().done(function () { + that.render(); + that.trigger('loaded'); + }); + }; this.model.clear(); this.model.set({ uuid: id, @@ -82,24 +88,12 @@ define([ }); this.requestComponent().done(function () { that.requestSource() - .done(function () { - that.requestDuplications().done(function () { - that.requestIssues().done(function () { - that.render(); - that.trigger('loaded'); - }); - }); - }) + .done(finalize) .fail(function () { - that.model.set({ - source: [ - { line: 0 } - ] - }); - that.requestIssues().done(function () { - that.render(); - that.trigger('loaded'); - }); + that.model.set({ source: [ + { line: 0 } + ] }); + finalize(); }); }); return this; @@ -295,7 +289,11 @@ define([ }, showDuplications: function () { - this.$el.addClass('source-duplications-expanded'); + var that = this; + this.requestDuplications().done(function () { + that.render(); + that.$el.addClass('source-duplications-expanded'); + }); }, showDuplicationPopup: function (e) { -- 2.39.5