Skip to content

Commit

Permalink
Session. Local track file load widget build out.
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Jan 24, 2024
1 parent a324b0f commit fc13606
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions js/sessionUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,20 @@ function createLocalTrackFileCard(parentElement, id, browser){

fileInputElement.addEventListener('change', async e => {

const {files} = fileInputElement
const names = Array.from(files).map(({ name }) => name)
const names = Array.from(fileInputElement.files).map(({ name }) => name)

if (names.length > 0) {

for (const name of names) {
const element = document.querySelector(`[data-filename="${ name }"]`)
if (null !== element) {
console.log(`Retrieved file named ${ element.innerText }`)
const listItemElement = document.querySelector(`[data-filename="${ name }"]`)
if (null !== listItemElement) {
console.log(`Retrieved file ${ name } is a local session file`)
listItemElement.style.backgroundColor = 'pink'
const inputElement = listItemElement.querySelector('input')
inputElement.checked = true
} else {
console.log(`Retrieved file ${ name } is NOT a local session file`)
}
}


}

})
Expand Down

0 comments on commit fc13606

Please sign in to comment.