Scope copied toast

This commit is contained in:
Jake Ginnivan 2020-08-01 18:09:14 +08:00 committed by GitHub
parent 0c3e8bf050
commit cc5844fa95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,13 +243,13 @@
`.svg`"
x-bind:download="downloadType === 'download-svg' && item.icon_name"
class="flex flex-col relative items-center group justify-center text-gray-700 rounded shadow hover:shadow-xl bg-white cursor-pointer transition duration-150 ease-in-out h-32 md:h-40"
@click="handleClick(item, downloadType, $event), $dispatch('show:toast'), setTimeout(() => $dispatch('show:toast'), 1000)"
@click="handleClick(item, downloadType, $event), $dispatch('show:toast', item.icon_name), setTimeout(() => $dispatch('show:toast', false), 1000)"
>
<div x-data="{ copied: false }">
<div
role="alert"
x-show="copied"
x-on:show:toast.document="copied = !copied"
x-show="copied === item.icon_name"
x-on:show:toast.document="copied = $event.detail"
x-cloak
class="rounded bg-black py-1 px-2 absolute top-0 -mt-8 left-0 right-0 text-sm text-white text-center mx-auto z-50"
style="width: fit-content;"