Merge pull request #1 from CoreyGinnivan/JakeGinnivan-patch-1

Scope copied toast
This commit is contained in:
Corey 2020-08-01 18:17:12 +08:00 committed by GitHub
commit 55da52c696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

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>
<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;"
@ -1410,6 +1410,7 @@
search: "",
downloadType: "copy-svg",
myForData: sourceData,
copied: false,
get filteredIcons() {
if (this.search === "") {
return this.myForData;