diff options
author | Azul <azul@riseup.net> | 2022-01-10 14:29:36 +0300 |
---|---|---|
committer | Julien Veyssier <eneiluj@posteo.net> | 2022-01-13 16:23:54 +0300 |
commit | 2b73d23537d6a5f8bf54a20a6815bbca1159c3a0 (patch) | |
tree | b9e563c84e38730536e96678350fb502ae48036b /src/components/MenuBubble.vue | |
parent | 9a07509183d2c368a77c771a44cb0884e9d7b3b5 (diff) |
hand the content wrapper to the menububble explicitly
Signed-off-by: Azul <azul@riseup.net>
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'src/components/MenuBubble.vue')
-rw-r--r-- | src/components/MenuBubble.vue | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/MenuBubble.vue b/src/components/MenuBubble.vue index 9343d72c1..e7a893f45 100644 --- a/src/components/MenuBubble.vue +++ b/src/components/MenuBubble.vue @@ -94,6 +94,12 @@ export default { required: false, default: null, }, + // used to calculate the position based on the scrollOffset + contentWrapper: { + type: Object, + required: false, + default: null, + }, filePath: { type: String, required: false, @@ -174,10 +180,10 @@ export default { command({ href: null }) }, bubblePosition(menu) { - const wrapper = this.$parent.$refs.wrapper const left = Math.max(this.minLeft, menu.left) + const offset = this.contentWrapper?.scrollTop || 0 return { - top: `${menu.top + wrapper.scrollTop + 5}px`, + top: `${menu.top + offset + 5}px`, left: `${left}px`, } }, |