aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-12-02 14:18:15 +0100
committerStas Vilchik <vilchiks@gmail.com>2014-12-02 14:18:20 +0100
commit0399fbfe3896d6e47006616063e7c46070cba95f (patch)
treec6f84f650c108c4f7c51cc46b48192101aa430a3
parent6d5a9ed67e32c23fb4edf87ab00559f5a3054dee (diff)
downloadsonarqube-0399fbfe3896d6e47006616063e7c46070cba95f.tar.gz
sonarqube-0399fbfe3896d6e47006616063e7c46070cba95f.zip
SONAR-5877 Integrate the duplications info
-rw-r--r--server/sonar-web/src/main/js/source-viewer/viewer.js36
1 files 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) {