Skip to content
Snippets Groups Projects
Commit e9dec7c1 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

use v-dialog

parent 42599b23
No related branches found
No related tags found
No related merge requests found
...@@ -7,22 +7,30 @@ ...@@ -7,22 +7,30 @@
<v-btn v-if="webShareApiSupported" depressed x-small class="toolbar-button" rounded tabindex="0" @click="shareViaWebShare"> <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-icon x-small>share</v-icon><span class = "button-text">Del ordet</span>
</v-btn> </v-btn>
<v-menu allow-overflow :close-on-content-click=false max-width="500px" min-width="50px" rounded="0" v-model="menu"> <v-dialog max-width="500px" rounded="0" v-model="citation_dialog">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<v-btn depressed x-small class="toolbar-button" rounded tabindex="0" v-on="on" v-bind="attrs"> <v-btn depressed x-small class="toolbar-button" rounded tabindex="0" v-on="on" v-bind="attrs">
<v-icon x-small>format_quote</v-icon> <span class = "button-text">Siter</span> <v-icon x-small>format_quote</v-icon> <span class = "button-text">Siter</span>
</v-btn> </v-btn>
</template> </template>
<v-card rounded="0" class="info-card"> <v-card rounded="0" class="info-card">
{{{"nn": "Ønskjer du å sitere denne artikkelen i Nynorskordboka, rår vi deg til å gje opp når artikkelen vart henta (lesen), t.d. slik:", {{{"nn": "Ønskjer du å sitere denne artikkelen i Nynorskordboka, rår vi deg til å gje opp når artikkelen vart henta (lesen), t.d. slik:",
"bm": "Ønsker du å sitere denne artikkelen i Bokmålsordboka, anbefaler vi å oppgi når artikkelen ble hentet (lest), f.eks. slik:"}[this.article.dictionary]}}<br/> "bm": "Ønsker du å sitere denne artikkelen i Bokmålsordboka, anbefaler vi å oppgi når artikkelen ble hentet (lest), f.eks. slik:"}[this.article.dictionary]}}<br/>
<div id = "citation" v-html="this.create_citation()"/> <div id = "citation" v-html="this.create_citation()"/>
<v-btn fixed depressed x-small class="toolbar-button" rounded tabindex="0" @click="copy_citation"><br>
<v-btn depressed x-small class="toolbar-button" rounded tabindex="0" @click="copy_citation"><br>
<v-icon x-small icon>content_copy</v-icon> Kopier <v-icon x-small icon>content_copy</v-icon> Kopier
</v-btn>
<v-btn depressed x-small class="toolbar-button" rounded tabindex="0" @click="close_citation_dialog"><br>
<v-icon x-small icon>get_app</v-icon> Last ned
</v-btn>
<v-btn depressed x-small class="toolbar-button" rounded tabindex="0" @click="close_citation_dialog"><br>
<v-icon x-small icon>close</v-icon> Avbryt
</v-btn> </v-btn>
</v-card> </v-card>
</v-menu> </v-dialog>
</div> </div>
</template> </template>
...@@ -44,7 +52,7 @@ export default { ...@@ -44,7 +52,7 @@ export default {
}, },
data: function() { data: function() {
return { return {
menu: false citation_dialog: false
} }
}, },
...@@ -79,9 +87,11 @@ export default { ...@@ -79,9 +87,11 @@ export default {
copy_citation() { copy_citation() {
let citation = document.getElementById("citation").textContent; let citation = document.getElementById("citation").textContent;
navigator.clipboard.writeText(citation) navigator.clipboard.writeText(citation)
console.log(citation) this.citation_dialog = false
},
this.menu = false close_citation_dialog() {
this.citation_dialog = false
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment