2222 <q-tooltip class =" bg-primary text-subtitle2" >
2323 Copy to clipboard
2424 </q-tooltip >
25- <q-tooltip
26- anchor =" center left"
27- self =" center right"
28- v-bind:offset =" [10, 10]"
29- no-parent-event
30- v-bind:model-value =" showTooltip"
31- class =" text-subtitle2"
32- >
33- Copied
34- <q-icon
35- size =" md"
36- name =" check"
37- class =" text-positive"
38- />
39- </q-tooltip >
4025 </q-btn >
4126 </template >
4227 </q-input >
6651</template >
6752
6853<script lang="ts">
69- import { computed , defineComponent , ref } from ' vue'
54+ import { computed , defineComponent } from ' vue'
7055import { useCffstr } from ' src/store/cffstr'
56+ import { useQuasar } from ' quasar'
7157import { useValidation } from ' src/store/validation'
7258
7359export default defineComponent ({
@@ -82,13 +68,19 @@ export default defineComponent({
8268 setup () {
8369 const { cffstr } = useCffstr ()
8470 const { errors } = useValidation ()
85- const showTooltip = ref ( false )
71+ const $q = useQuasar ( )
8672
8773 const copyToClipboard = async () => {
8874 await navigator .clipboard .writeText (cffstr .value )
89- showTooltip .value = true
90- await new Promise (resolve => setTimeout (resolve , 3000 ))
91- showTooltip .value = false
75+ $q .notify ({
76+ message: ' CITATION.cff copied!' ,
77+ color: ' primary' ,
78+ progress: true ,
79+ timeout: 800 ,
80+ actions: [
81+ { label: ' Dismiss' , color: ' white' }
82+ ]
83+ })
9284 }
9385
9486 return {
@@ -97,8 +89,7 @@ export default defineComponent({
9789 doesNotHaveRequiredFields: computed (() => errors .value
9890 .map ((v ) => v .instancePath )
9991 .some ((i ) => i .includes (' title' ) || i .includes (' authors' ) || i .includes (' message' ))),
100- isValidCFF: computed (() => errors .value .length === 0 ),
101- showTooltip
92+ isValidCFF: computed (() => errors .value .length === 0 )
10293 }
10394 }
10495})
0 commit comments