diff options
author | Fatih Acet <acetfatih@gmail.com> | 2018-07-04 01:27:27 +0200 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2018-07-04 01:34:43 +0200 |
commit | 98aeab2848d94da55640aaf756d014e40ea01d2d (patch) | |
tree | cd65f5f2d89d81ba429d7bdae830160d60cbdd16 /app/assets/javascripts/diffs | |
parent | eba05eb8d48445e6560f3ecbc3f3eb649da00e57 (diff) | |
download | gitlab-ce-98aeab2848d94da55640aaf756d014e40ea01d2d.tar.gz |
Fix parallel diff lines content.
Diffstat (limited to 'app/assets/javascripts/diffs')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_table_cell.vue | 12 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/components/parallel_diff_table_row.vue | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_table_cell.vue b/app/assets/javascripts/diffs/components/diff_table_cell.vue index fdefd63ced2..5b08b161114 100644 --- a/app/assets/javascripts/diffs/components/diff_table_cell.vue +++ b/app/assets/javascripts/diffs/components/diff_table_cell.vue @@ -11,6 +11,8 @@ import { LINE_HOVER_CLASS_NAME, LINE_UNFOLD_CLASS_NAME, INLINE_DIFF_VIEW_TYPE, + LINE_POSITION_LEFT, + LINE_POSITION_RIGHT, } from '../constants'; export default { @@ -65,11 +67,17 @@ export default { computed: { ...mapGetters(['isLoggedIn']), normalizedLine() { + let normalizedLine; + if (this.diffViewType === INLINE_DIFF_VIEW_TYPE) { - return this.line; + normalizedLine = this.line; + } else if (this.linePosition === LINE_POSITION_LEFT) { + normalizedLine = this.line.left; + } else if (this.linePosition === LINE_POSITION_RIGHT) { + normalizedLine = this.line.right; } - return this.lineType === OLD_LINE_TYPE ? this.line.left : this.line.right; + return normalizedLine; }, isMatchLine() { return this.normalizedLine.type === MATCH_LINE_TYPE; diff --git a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue index 9cb68971c49..eb769584d74 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue @@ -118,6 +118,7 @@ export default { :diff-file="diffFile" :line="line" :is-content-line="true" + :line-position="linePositionLeft" :line-type="parallelViewLeftLineType" :diff-view-type="parallelDiffViewType" class="line_content parallel left-side" @@ -139,6 +140,7 @@ export default { :diff-file="diffFile" :line="line" :is-content-line="true" + :line-position="linePositionRight" :line-type="line.right.type" :diff-view-type="parallelDiffViewType" class="line_content parallel right-side" |