Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2021-10-27 17:44:39 +0300
committerJulius Härtl <jus@bitgrid.net>2021-11-05 18:42:33 +0300
commit82afd6a77461c86839febf3acb28623ab6ebf288 (patch)
tree0c6a7f2c26cca91c6a507184fbc7a41db918f90a /src
parenta07fe2d32be617446d26132d87293e735452fadc (diff)
Display menububble below the first line of text
For the rest of the text we keep the position above. Signed-off-by: Azul <azul@riseup.net>
Diffstat (limited to 'src')
-rw-r--r--src/components/MenuBubble.vue14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/MenuBubble.vue b/src/components/MenuBubble.vue
index c3956fc79..059ee4db7 100644
--- a/src/components/MenuBubble.vue
+++ b/src/components/MenuBubble.vue
@@ -25,7 +25,9 @@
class="menububble"
:editor="editor"
@hide="hideLinkMenu">
- <div class="menububble" :class="{ 'is-active': menu.isActive }" :style="`left: ${menu.left}px; bottom: ${menu.bottom}px;`">
+ <div class="menububble"
+ :class="{ 'is-active': menu.isActive }"
+ :style="bubblePosition(menu)">
<form v-if="linkMenuIsActive" class="menububble__form" @submit.prevent="setLinkUrl(commands.link, linkUrl)">
<input ref="linkInput"
v-model="linkUrl"
@@ -140,6 +142,16 @@ export default {
command({ href: url })
this.hideLinkMenu()
},
+ bubblePosition(menu) {
+ // below the first line, above all others
+ const vertical = menu.top < 45
+ ? { top: `${menu.top}px` }
+ : { bottom: `${menu.bottom}px` }
+ return {
+ ...vertical,
+ left: `${menu.left}px`,
+ }
+ }
},
}
</script>