From 4b56bfb1fa9b5278c030341a5f0770c0cc3fae68 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 14 Nov 2014 13:27:15 +0100 Subject: [PATCH] SONAR-5718 Fix clipping effect of the black header --- .../src/main/coffee/issues/component-viewer/main.coffee | 7 ++++++- .../src/main/hbs/issues/issues-component-viewer.hbs | 2 +- server/sonar-web/src/main/less/issues.less | 4 ++++ 3 files changed, 11 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 33339dbb453..47ff206ae9e 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 @@ -223,6 +223,9 @@ define [ line = issue.get('line') || 0 @model.set key: componentKey, issueLine: line + # disable clipping effect of the black header + @$el.addClass 'full-height' + @requestSources(line - LINES_AROUND, line + LINES_AROUND) .done (data) => formattedSource = _.map data.sources, (item) => lineNumber: item[0], code: item[1] @@ -235,7 +238,6 @@ define [ hasSourceBefore: firstLine > 1 hasSourceAfter: lastLine == line + LINES_AROUND @render() - @scrollToLine issue.get 'line' @bindScrollEvents() @requestIssues() .fail => @@ -244,6 +246,9 @@ define [ formattedSource: [] @model.set hasSourceBefore: false, hasSourceAfter: false @render() + .always => + @$el.removeClass 'full-height' + @scrollToLine issue.get 'line' requestSources: (lineFrom, lineTo) -> diff --git a/server/sonar-web/src/main/hbs/issues/issues-component-viewer.hbs b/server/sonar-web/src/main/hbs/issues/issues-component-viewer.hbs index 1fe6686a28d..598ba295bf5 100644 --- a/server/sonar-web/src/main/hbs/issues/issues-component-viewer.hbs +++ b/server/sonar-web/src/main/hbs/issues/issues-component-viewer.hbs @@ -1,4 +1,4 @@ -
+
{{#if hasSourceBefore}} {{/if}} diff --git a/server/sonar-web/src/main/less/issues.less b/server/sonar-web/src/main/less/issues.less index 548c76b09b2..6bd37c9f964 100644 --- a/server/sonar-web/src/main/less/issues.less +++ b/server/sonar-web/src/main/less/issues.less @@ -304,6 +304,10 @@ .issues-workspace-component-viewer { padding: 1px 10px; + &.full-height { + min-height: 100vh; + } + .code-issue-modern { margin: 5px 0; } -- 2.39.5