Skip to content

Commit ebc6b53

Browse files
committed
changes per code review
1 parent 334747e commit ebc6b53

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/widgets/mmu/MmuUnit.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
<v-menu
1313
v-model="gateMenuVisible[g]"
1414
:disabled="g === gate"
15+
:position-x="menuX"
16+
:position-y="menuY"
1517
:close-on-content-click="false"
1618
:open-on-click="false"
1719
transition="slide-y-transition"
20+
absolute
1821
offset-y
1922
>
2023
<template #activator="{ attrs: menuAttrs }">
@@ -51,7 +54,10 @@
5154
</v-tooltip>
5255
</template>
5356

54-
<v-list dense>
57+
<v-list
58+
dense
59+
@mouseleave="closeContextMenu"
60+
>
5561
<v-subheader class="compact-subheader">
5662
Gate {{ g }}
5763
</v-subheader>
@@ -62,7 +68,7 @@
6268
>
6369
<v-btn
6470
small
65-
class="width: 100%"
71+
style="width: 100%"
6672
:disabled="!klippyReady || !canSend"
6773
:loading="hasWait(item.loading)"
6874
@click="contextMenuCommand(item.command, item.loading, g)"
@@ -263,6 +269,8 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
263269
264270
vendorLogo = ''
265271
closeTimeout: number | null = null
272+
menuX: number = 0
273+
menuY: number = 0
266274
267275
@Watch('unit', { immediate: true })
268276
onUnit (value: number) {
@@ -456,6 +464,8 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
456464
this.closeContextMenu()
457465
return
458466
}
467+
this.menuX = e.clientX - 20
468+
this.menuY = e.clientY - 20
459469
this.closeContextMenu()
460470
this.$set(this.gateMenuVisible, gate, true)
461471
this.closeTimeout = window.setTimeout(() => {
@@ -476,6 +486,7 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
476486
this.closeTimeout = null
477487
}
478488
489+
/*
479490
mounted () {
480491
addEventListener('mmu-close-gate-context-menus', this.closeContextMenu)
481492
}
@@ -484,6 +495,7 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
484495
removeEventListener('mmu-close-gate-context-menus', this.closeContextMenu)
485496
this.clearCloseTimeout()
486497
}
498+
*/
487499
}
488500
</script>
489501

0 commit comments

Comments
 (0)