Commit f5735a14 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

add copy notification

parent 30c5ab92
<template>
<div class="article_footer">
<v-btn v-if="!webShareApiSupported || $vuetify.breakpoint.mdAndUp" x-small depressed class="toolbar-button" rounded tabindex="0" @click="copy_link">
<v-icon small>link</v-icon> <span class = "button-text">Kopier lenke</span>
<v-snackbar center left light
v-model='copy_popup'
timeout="2000">
<span class="text-center">Kopiert til utklippstavla</span>
<template v-slot:action="{ attrs }">
<v-btn
color="primary"
text
v-bind="attrs"
@click="copy_popup = false"
>
<v-icon>close</v-icon>
</v-btn>
</template>
</v-snackbar>
<v-btn v-if="!webShareApiSupported || $vuetify.breakpoint.mdAndUp"
x-small depressed class="toolbar-button" rounded tabindex="0" @click="copy_link">
<v-icon small>link</v-icon><span class = "button-text">Kopier lenke</span>
</v-btn>
<v-btn v-if="webShareApiSupported" depressed x-small class="toolbar-button" rounded tabindex="0" @click="shareViaWebShare">
<v-icon x-small>share</v-icon><span class = "button-text">Del ordet</span>
</v-btn>
......@@ -52,6 +70,7 @@ export default {
},
data: function() {
return {
copy_popup: false,
citation_dialog: false
}
......@@ -85,12 +104,15 @@ export default {
},
copy_link() {
navigator.clipboard.writeText(this.create_link());
this.copy_popup = true
},
copy_citation() {
let citation = document.getElementById("citation").textContent;
navigator.clipboard.writeText(citation)
this.citation_dialog = false
this.copy_popup = true
},
close_citation_dialog() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment