From fe3e5e78b77fbb2b5eede3ea4154989c244e38b3 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Fri, 22 Jun 2018 01:40:12 +0300 Subject: Minor refactor for readability. --- app/assets/javascripts/diffs/components/diff_table_row.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/diffs/components/diff_table_row.vue b/app/assets/javascripts/diffs/components/diff_table_row.vue index 07da1e1d360..f2d2a8dcd7a 100644 --- a/app/assets/javascripts/diffs/components/diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/diff_table_row.vue @@ -56,6 +56,11 @@ export default { [PARALLEL_DIFF_VIEW_TYPE]: this.isParallelView, }; }, + inlineRowId() { + const { lineCode, oldLine, newLine } = this.line; + + return lineCode || `${this.diffFile.fileHash}_${oldLine}_${newLine}`; + }, }, methods: { handleMouse(e) { @@ -65,8 +70,8 @@ export default { this.isHover = isHover; } else { const hoveringCell = e.target.closest('td'); - const allCells = Array.from(e.currentTarget.children); - const hoverIndex = allCells.indexOf(hoveringCell); + const allCellsInHoveringRow = Array.from(e.currentTarget.children); + const hoverIndex = allCellsInHoveringRow.indexOf(hoveringCell); if (hoverIndex >= 2) { this.isRightHover = isHover; @@ -88,7 +93,7 @@ export default {