add copy button for sharing vorgang
This commit is contained in:
@@ -129,11 +129,24 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
async function setClipboard(text) {
|
||||
const type = "text/plain";
|
||||
const clipboardItemData = {
|
||||
[type]: text,
|
||||
};
|
||||
const clipboardItem = new ClipboardItem(clipboardItemData);
|
||||
await navigator.clipboard.write([clipboardItem]);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="-z-10 bg-white">
|
||||
<div class="flex flex-col items-center justify-center w-full">
|
||||
<h1 class="text-xl">Vorgang {vorg.name}</h1>
|
||||
{#if data?.user?.admin}
|
||||
Zugangspasswort: {vorg.pw}
|
||||
<Button on:click={() => setClipboard($page.url.toString().split('?')[0])}>Copy Link</Button>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="mx-auto flex justify-center max-w-7xl h-full">
|
||||
<ul class="divide-y divide-gray-100">
|
||||
|
||||
Reference in New Issue
Block a user