add copy feedback
This commit is contained in:
parent
0ac3c8ea60
commit
ef9373a70f
|
@ -18,7 +18,7 @@
|
||||||
<input type="checkbox" id="bigplayer_active" bind:checked={isBigPlayer}>
|
<input type="checkbox" id="bigplayer_active" bind:checked={isBigPlayer}>
|
||||||
<label for="bigplayer_active">active big player</label>
|
<label for="bigplayer_active">active big player</label>
|
||||||
</div>
|
</div>
|
||||||
<button class="modalShare__copy" on:click={() => copyUrl()}>copy</button>
|
<button class="modalShare__copy" on:click={() => copyUrl()}>{ copied ? 'copied' : 'copy' }</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
let open = false
|
let open = false
|
||||||
let isBigPlayer = false
|
let isBigPlayer = false
|
||||||
|
let copied = false
|
||||||
|
|
||||||
$: shareUrlInput = track.shareUrl + (isBigPlayer ? '?large' : '')
|
$: shareUrlInput = track.shareUrl + (isBigPlayer ? '?large' : '')
|
||||||
|
|
||||||
const closeMenu = getContext('closeMenu')
|
const closeMenu = getContext('closeMenu')
|
||||||
|
@ -50,5 +52,7 @@
|
||||||
|
|
||||||
function copyUrl () {
|
function copyUrl () {
|
||||||
copy(shareUrlInput)
|
copy(shareUrlInput)
|
||||||
|
copied = true
|
||||||
|
setTimeout(() => copied = false, 2000)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue