From 41546b4487f4b5eea02f43a8cd59aed017a01371 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 4 Nov 2014 15:50:43 +0100 Subject: [PATCH] SONAR-5718 Fix infinite scrolling of sources --- .../src/main/coffee/issues/component-viewer/main.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee index f269fd143bc..a05373fe66a 100644 --- a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee +++ b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee @@ -172,9 +172,11 @@ define [ @source.set source: data.sources formattedSource: formattedSource + firstLine = _.first(formattedSource).lineNumber + lastLine = _.last(formattedSource).lineNumber @model.set - hasSourceBefore: line > LINES_AROUND - hasSourceAfter: formattedSource.length > 2 * LINES_AROUND + 1 + hasSourceBefore: firstLine > 1 + hasSourceAfter: lastLine == line + LINES_AROUND @render() @highlightIssue issue.get 'key' @scrollToLine issue.get 'line' -- 2.39.5