Hide mouse buttons using visibility: hidden
This commit is contained in:
parent
7a58ac37f7
commit
4b6732ccd0
2 changed files with 11 additions and 10 deletions
|
|
@ -176,14 +176,14 @@ function onCreateEditorFinish(text: string): void {
|
||||||
<div v-else class="px-1 font-light italic">note not found</div>
|
<div v-else class="px-1 font-light italic">note not found</div>
|
||||||
|
|
||||||
<!-- Controls -->
|
<!-- Controls -->
|
||||||
<div v-if="hover || pinned" class="absolute right-0 flex h-6 items-center gap-0.5">
|
<div class="absolute right-0 flex h-6 items-center gap-0.5">
|
||||||
<CNoteButton v-if="hover" @click.stop="onEditButtonClick">
|
<CNoteButton :visible="hover" @click.stop="onEditButtonClick">
|
||||||
<RiEditLine size="16px" />
|
<RiEditLine size="16px" />
|
||||||
</CNoteButton>
|
</CNoteButton>
|
||||||
<CNoteButton v-if="hover" @click.stop="onCreateButtonClick">
|
<CNoteButton :visible="hover" @click.stop="onCreateButtonClick">
|
||||||
<RiStickyNoteAddLine size="16px" />
|
<RiStickyNoteAddLine size="16px" />
|
||||||
</CNoteButton>
|
</CNoteButton>
|
||||||
<CNoteButton :inverted="pinned" @click.stop="onPinButtonClick">
|
<CNoteButton :visible="hover || pinned" :inverted="pinned" @click.stop="onPinButtonClick">
|
||||||
<RiPushpinFill v-if="pinned" size="16px" />
|
<RiPushpinFill v-if="pinned" size="16px" />
|
||||||
<RiPushpinLine v-else size="16px" />
|
<RiPushpinLine v-else size="16px" />
|
||||||
</CNoteButton>
|
</CNoteButton>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{
|
const { visible, inverted = false } = defineProps<{
|
||||||
|
visible: boolean;
|
||||||
inverted?: boolean;
|
inverted?: boolean;
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -7,11 +8,11 @@ const props = defineProps<{
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="flex select-none items-center rounded-sm border p-0.5 transition hover:bg-neutral-200 active:scale-95"
|
class="flex select-none items-center rounded-sm border p-0.5 transition hover:bg-neutral-200 active:scale-95"
|
||||||
:class="
|
:class="{
|
||||||
props.inverted
|
'bg-white text-black': !inverted,
|
||||||
? 'border-black bg-black text-white hover:bg-neutral-600'
|
'border-black bg-black text-white hover:bg-neutral-600': inverted,
|
||||||
: 'bg-white text-black'
|
hidden: !visible,
|
||||||
"
|
}"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue