FIX: hoverButtons on drag

This commit is contained in:
Robert Kossessa
2024-02-07 02:17:07 +01:00
parent 364b4578cb
commit f9b1d066d3
2 changed files with 9 additions and 2 deletions

View File

@@ -1,8 +1,9 @@
<template> <template>
<div <div
class="h-12 flex overflow-hidden rounded-lg m-2 group transition-all" class="h-12 flex overflow-hidden rounded-lg m-2 transition-all"
:class="{'border border-zinc-100 bg-zinc-300': selected, :class="{'border border-zinc-100 bg-zinc-300': selected,
'border border-transparent hover:border-zinc-900': !selected}"> 'border border-transparent hover:border-zinc-900': !selected,
'group': showHoverButtons}">
<form <form
v-if="nameEditable && editing" v-if="nameEditable && editing"
class="flex-1 flex h-full text-left whitespace-nowrap overflow-hidden" class="flex-1 flex h-full text-left whitespace-nowrap overflow-hidden"
@@ -24,6 +25,7 @@
<Check class="h-4 w-4" /> <Check class="h-4 w-4" />
</button> </button>
</form> </form>
<!-- TODO: Make hover buttons use Transition(Group) and v-if directive -->
<button <button
v-else v-else
:class="{'font-semibold bg-zinc-300 hover:bg-zinc-200 text-black' : selected, :class="{'font-semibold bg-zinc-300 hover:bg-zinc-200 text-black' : selected,
@@ -136,6 +138,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
showHoverButtons: {
type: Boolean,
default: true,
},
}) })
async function startEditing() { async function startEditing() {

View File

@@ -68,6 +68,7 @@
<div :key="element.name"> <div :key="element.name">
<ProfileButton <ProfileButton
:profile="element" :profile="element"
:show-hover-buttons="!drag"
:selected="store.selectedProfile?.id === element.id" :selected="store.selectedProfile?.id === element.id"
@select="store.selectProfile(element.id); showProfileConfig=true" @select="store.selectProfile(element.id); showProfileConfig=true"
@duplicate="store.duplicateProfile(element.id)" @duplicate="store.duplicateProfile(element.id)"