mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Fix wrong element's dynamic identifier, semicols (#1080)
This commit is contained in:
parent
10b42525ad
commit
fe9ea62f61
@ -26,40 +26,40 @@
|
||||
const form = document.getElementById('form')
|
||||
|
||||
const dynamicEvent = e => {
|
||||
const target = e.target
|
||||
const target = e.target;
|
||||
|
||||
gun.get(target.id).put(null)
|
||||
gun.get(target.id).put(null);
|
||||
|
||||
target.innerHTML = document.getElementById(target.innerHTML)
|
||||
target.innerHTML = document.getElementById(target.id);
|
||||
|
||||
if (target.innerHTML === ' null' || target.innerHTML === ' ' || target.innerHTML === '') {
|
||||
target.style.display = 'none'
|
||||
target.style.display = 'none';
|
||||
} else {
|
||||
target.style.display = 'list-item'
|
||||
target.style.display = 'list-item';
|
||||
}
|
||||
}
|
||||
|
||||
gun.map().on((thought, id) => {
|
||||
parentList.insertAdjacentHTML('beforeend', `<li id =${id}> ${thought}</li>`)
|
||||
parentList.insertAdjacentHTML('beforeend', `<li id =${id}> ${thought}</li>`);
|
||||
|
||||
const links = parentList.getElementsByTagName('li')
|
||||
const links = parentList.getElementsByTagName('li');
|
||||
|
||||
for (const link of links) {
|
||||
if (link.innerHTML === ' null' || link.innerHTML === ' ' || link.innerHTML === '') {
|
||||
link.style.display = 'none'
|
||||
link.style.display = 'none';
|
||||
} else {
|
||||
link.style.display = 'list-item'
|
||||
link.style.display = 'list-item';
|
||||
}
|
||||
link.ondblclick = dynamicEvent
|
||||
link.ondblclick = dynamicEvent;
|
||||
}
|
||||
})
|
||||
|
||||
form.addEventListener('submit', e => {
|
||||
e.preventDefault()
|
||||
gun.set(input.value)
|
||||
input.value = ''
|
||||
e.preventDefault();
|
||||
gun.set(input.value);
|
||||
input.value = '';
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user