mirror of
https://github.com/CoreyGinnivan/system-uicons.git
synced 2024-05-19 13:56:34 +02:00
Show more descriptive toast
This commit is contained in:
parent
55da52c696
commit
3635f85cab
|
@ -243,7 +243,7 @@
|
||||||
`.svg`"
|
`.svg`"
|
||||||
x-bind:download="downloadType === 'download-svg' && item.icon_name"
|
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"
|
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', item.icon_name), setTimeout(() => $dispatch('show:toast', false), 1000)"
|
@click="handleClick(item, downloadType, $event, $dispatch)"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
|
@ -260,7 +260,9 @@
|
||||||
x-transition:leave-start="opacity-100 transform scale-100"
|
x-transition:leave-start="opacity-100 transform scale-100"
|
||||||
x-transition:leave-end="opacity-0 transform scale-90"
|
x-transition:leave-end="opacity-0 transform scale-90"
|
||||||
>
|
>
|
||||||
Copied
|
<template x-if="downloadType == 'download-svg'">Downloading!</template>
|
||||||
|
<template x-if="downloadType == 'copy-cdn'">Copied URL</template>
|
||||||
|
<template x-if="downloadType == 'copy-svg'">Copied SVG Code</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
|
@ -1421,7 +1423,7 @@
|
||||||
.includes(this.search.toLowerCase());
|
.includes(this.search.toLowerCase());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleClick(item, downloadType, event) {
|
handleClick(item, downloadType, event, $dispatch) {
|
||||||
if (downloadType === "copy-svg") {
|
if (downloadType === "copy-svg") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var url =
|
var url =
|
||||||
|
@ -1435,6 +1437,8 @@
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
response.text().then(function (svg) {
|
response.text().then(function (svg) {
|
||||||
navigator.clipboard.writeText(svg);
|
navigator.clipboard.writeText(svg);
|
||||||
|
$dispatch('show:toast', item.icon_name)
|
||||||
|
setTimeout(() => $dispatch('show:toast', false), 1000)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1449,6 +1453,12 @@
|
||||||
item.icon_path +
|
item.icon_path +
|
||||||
`.svg`;
|
`.svg`;
|
||||||
navigator.clipboard.writeText(url);
|
navigator.clipboard.writeText(url);
|
||||||
|
|
||||||
|
$dispatch('show:toast', item.icon_name)
|
||||||
|
setTimeout(() => $dispatch('show:toast', false), 1000)
|
||||||
|
} else {
|
||||||
|
$dispatch('show:toast', item.icon_name)
|
||||||
|
setTimeout(() => $dispatch('show:toast', false), 1000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue