|
|
|
@ -176,7 +176,7 @@ taginputs.forEach(function (tinput) {
|
|
|
|
|
let newtag = create_selection_tag(tagname)
|
|
|
|
|
newtag.addEventListener('click', (event) => {
|
|
|
|
|
remove_selected(event.target.dataset.tagname)
|
|
|
|
|
// console.log(`Deselected: ${event.target.dataset.tagname}`)
|
|
|
|
|
event.preventDefault()
|
|
|
|
|
|
|
|
|
|
setTimeout(() => suggest_input.focus(), 2)
|
|
|
|
|
})
|
|
|
|
@ -219,12 +219,22 @@ taginputs.forEach(function (tinput) {
|
|
|
|
|
// add_selected(tag)
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
let vals = suggest_input.value.split(' ')
|
|
|
|
|
// console.log(vals)
|
|
|
|
|
vals.forEach(tag => {
|
|
|
|
|
if (tag == '') return
|
|
|
|
|
add_selected(tag)
|
|
|
|
|
});
|
|
|
|
|
// let vals = suggest_input.value.split(' ')
|
|
|
|
|
// // console.log(vals)
|
|
|
|
|
// vals.forEach(tag => {
|
|
|
|
|
// if (tag == '') return
|
|
|
|
|
// add_selected(tag)
|
|
|
|
|
// });
|
|
|
|
|
// Not as clean, but well whatever
|
|
|
|
|
selected.querySelectorAll("a").forEach(element => {
|
|
|
|
|
element.addEventListener('click', (event) => {
|
|
|
|
|
remove_selected(event.target.dataset.tagname)
|
|
|
|
|
event.preventDefault()
|
|
|
|
|
|
|
|
|
|
setTimeout(() => suggest_input.focus(), 2)
|
|
|
|
|
})
|
|
|
|
|
hidden_addtag(element.dataset.tagname)
|
|
|
|
|
})
|
|
|
|
|
suggest_input.removeAttribute('value') // Disable prefill by browser
|
|
|
|
|
|
|
|
|
|
function select_suggestion(tagelement) {
|
|
|
|
|