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"