Skip to content

Commit e782878

Browse files
committed
fix el access, fix hover
1 parent 5cd082e commit e782878

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

web_src/js/components/DiffCommitSelector.vue

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export default {
1010
return {
1111
menuVisible: false,
1212
isLoading: false,
13+
queryParams: el.getAttribute('data-queryparams'),
14+
issueLink: el.getAttribute('data-issuelink'),
1315
locale: {
1416
filter_changes_by_commit: el.getAttribute('data-filter_changes_by_commit'),
1517
},
@@ -27,12 +29,6 @@ export default {
2729
}
2830
return 0;
2931
},
30-
queryParams() {
31-
return this.$el.parentNode.getAttribute('data-queryparams');
32-
},
33-
issueLink() {
34-
return this.$el.parentNode.getAttribute('data-issuelink');
35-
},
3632
},
3733
mounted() {
3834
document.body.addEventListener('click', this.onBodyClick);
@@ -216,8 +212,8 @@ export default {
216212
</div>
217213
<!-- only show the show changes since last review if there is a review AND we are commits ahead of the last review -->
218214
<div
219-
v-if="lastReviewCommitSha != null" role="menuitem"
220-
class="item"
215+
v-if="lastReviewCommitSha != null"
216+
class="item" role="menuitem"
221217
:class="{disabled: !commitsSinceLastReview}"
222218
@keydown.enter="changesSinceLastReviewClick()"
223219
@click="changesSinceLastReviewClick()"
@@ -233,7 +229,7 @@ export default {
233229
<template v-for="commit in commits" :key="commit.id">
234230
<div
235231
class="item" role="menuitem"
236-
:class="{active: commit.selected}"
232+
:class="{selected: commit.selected, hovered: commit.hovered}"
237233
@keydown.enter.exact="commitClicked(commit.id)"
238234
@keydown.enter.shift.exact="commitClickedShift(commit)"
239235
@mouseover.shift="highlight(commit)"
@@ -288,6 +284,14 @@ export default {
288284
border-top: 1px solid var(--color-secondary) !important;
289285
}
290286
287+
.ui.dropdown.diff-commit-selector .menu > .item.hovered {
288+
background-color: var(--color-small-accent);
289+
}
290+
291+
.ui.dropdown.diff-commit-selector .menu > .item.selected {
292+
background-color: var(--color-accent);
293+
}
294+
291295
.ui.dropdown.diff-commit-selector .menu > .item:focus {
292296
color: var(--color-text);
293297
background: var(--color-hover);

0 commit comments

Comments
 (0)