Skip to content

Commit

Permalink
Fix tooltip location close on click.
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed May 22, 2024
1 parent 1c0a2f2 commit b389e28
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions js/preview/preview_toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-card class="pa-2">
<div class="d-flex align-center">
<span class="text-h6 flex-grow-1">{{ t('preview.title') }}</span>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
:href="fileUrl"
Expand All @@ -16,7 +16,7 @@
</template>
<span>{{ t('preview.download') }}</span>
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand Down
2 changes: 1 addition & 1 deletion js/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class="logo"
/>
</h1>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand Down
34 changes: 18 additions & 16 deletions js/toolbar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<v-card class="d-flex align-center pa-1">
<v-tooltip bottom>
<v-tooltip
:disabled="menu"
location="bottom"
>
<template v-slot:activator="{ props }">
<v-btn
icon
Expand All @@ -26,20 +29,19 @@
class="mx-2"
@updateBounds="updateBounds"
/>
<v-menu>
<template v-slot:activator="{ props: menu, value }">
<v-tooltip bottom :disabled="value">
<v-menu v-model="editOpen">
<template v-slot:activator="{ props: menu }">
<v-tooltip location="bottom" :disabled="editOpen">
<template v-slot:activator="{ props: tooltip }">
<div v-bind="tooltip">
<v-btn
:disabled="editDisabled"
icon
variant="plain"
v-bind="menu"
<v-btn
:disabled="editDisabled"
icon
variant="plain"
v-bind="mergeProps(tooltip, menu)"
>
<v-icon>{{ mdiPencilOutline }}</v-icon>
</v-btn>
</div>
{{ value }}
<v-icon>{{ mdiPencilOutline }}</v-icon>
</v-btn>
</template>
<span>{{ editDisabled ? $t('toolbar.zoom_to_edit') : $t('toolbar.edit') }}</span>
</v-tooltip>
Expand Down Expand Up @@ -69,19 +71,19 @@
</template>

<script>
import { mergeProps } from 'vue';
import { mdiPencilOutline } from '@mdi/js';
import GeocoderInput from './geocoder';
import { useNews } from './news';
import equalLogo from 'data-url:../icons/equal.svg';
export default {
components: {
GeocoderInput
},
setup() {
const { hasUnreadNews } = useNews();
return { hasUnreadNews};
return { hasUnreadNews, mergeProps };
},
props: {
Expand Down Expand Up @@ -117,7 +119,7 @@ export default {
},
data() {
return { equalLogo, mdiPencilOutline };
return { equalLogo, mdiPencilOutline, editOpen: false };
},
computed: {
Expand Down

0 comments on commit b389e28

Please sign in to comment.