From 32dffb03da285890ab2c89a8bddec86cba5d619b Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 2 Feb 2015 10:16:23 +0100 Subject: [PATCH] SONAR-6144 Component Viewer doesn't show coverage after line 1'000 --- server/sonar-web/src/main/js/source-viewer/viewer.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 fd234f62677..85d14bc9a94 100644 --- a/server/sonar-web/src/main/js/source-viewer/viewer.js +++ b/server/sonar-web/src/main/js/source-viewer/viewer.js @@ -165,7 +165,7 @@ define([ source.unshift({line: 0}); } source = source.map(function (row) { - return _.extend(row, {coverageStatus: that.getCoverageStatus(row)}); + return _.extend(row, { coverageStatus: that.getCoverageStatus(row) }); }); var firstLine = _.first(source).line, linesRequested = options.to - options.from + 1; @@ -539,6 +539,9 @@ define([ if (source.length === 0 || (source.length > 0 && _.first(source).line === 1)) { source.unshift({line: 0}); } + source = source.map(function (row) { + return _.extend(row, { coverageStatus: that.getCoverageStatus(row) }); + }); that.model.set({ source: source, hasSourceBefore: (data.sources.length === that.LINES_AROUND) && (_.first(source).line > 0) @@ -574,6 +577,9 @@ define([ source = source.slice(source.length - that.TOTAL_LINES_LIMIT); that.model.set({ hasSourceBefore: true }); } + source = source.map(function (row) { + return _.extend(row, { coverageStatus: that.getCoverageStatus(row) }); + }); that.model.set({ source: source, hasSourceAfter: data.sources.length === that.LINES_AROUND -- 2.39.5