click to duplicate comments

main
Matthew Huntington 3 months ago
parent 3e619cb27f
commit 19d7a922c0

@ -4,6 +4,7 @@
import { onMounted, ref, watch, defineProps } from 'vue' import { onMounted, ref, watch, defineProps } from 'vue'
import { import {
description, description,
comments,
currentWorkingCategory, currentWorkingCategory,
currentWorkingInstrument currentWorkingInstrument
} from '../libs/state.js' } from '../libs/state.js'
@ -14,6 +15,10 @@
description.value = event.target.innerText description.value = event.target.innerText
} }
const copyComments = (event) => {
comments.value = event.target.innerText
}
onMounted(()=>{ onMounted(()=>{
loadCategory() loadCategory()
window.addEventListener('keydown', (event)=>{ window.addEventListener('keydown', (event)=>{
@ -51,7 +56,7 @@
<tbody> <tbody>
<tr v-for="session in categorySessions"> <tr v-for="session in categorySessions">
<td @click="copy">{{session.description}}</td> <td @click="copy">{{session.description}}</td>
<td>{{session.comments}}</td> <td @click="copyComments">{{session.comments}}</td>
<td> <td>
<ul> <ul>
<li v-for="song in session.songs"> <li v-for="song in session.songs">

@ -36,7 +36,8 @@
copiedSongs, copiedSongs,
currentWorkingCategory, currentWorkingCategory,
currentWorkingInstrument, currentWorkingInstrument,
description description,
comments
} from '../libs/state.js' } from '../libs/state.js'
export default { export default {
@ -80,8 +81,8 @@
reqBody.songs = copiedSongs.value reqBody.songs = copiedSongs.value
} }
if(this.comments){ if(comments.value){
reqBody.comments = this.comments reqBody.comments = comments.value
} }
axios.post( axios.post(
@ -92,7 +93,7 @@
copiedSongs.value = [] copiedSongs.value = []
this.totalSeconds = 0; this.totalSeconds = 0;
this.savedPreviousSeconds = 0; this.savedPreviousSeconds = 0;
this.comments = null; comments.value = null;
this.secondsToSubtract = 0; this.secondsToSubtract = 0;
this.manualHours = 0 this.manualHours = 0
this.manualMinutes = 0 this.manualMinutes = 0

@ -5,3 +5,4 @@ export const currentWorkingInstrument = ref(null)
export const instruments = ref([]) export const instruments = ref([])
export const categories = ref([]) export const categories = ref([])
export const description = ref(null) export const description = ref(null)
export const comments = ref(null)

Loading…
Cancel
Save