FEATURE: Make tags clickable to edit them

This commit is contained in:
Dominique Barton 2020-02-23 01:20:38 +01:00
parent ebce639bf3
commit a78c163008
2 changed files with 15 additions and 0 deletions

View file

@ -170,6 +170,20 @@ api = new API()
api.refreshRegistry();
api.refreshTagClasses();
document.addEventListener('click', function(event)
{
let target = event.target
let div = target.closest('div')
if(div && div.classList.contains('tag'))
{
for(let child of div.children)
{
document.getElementById(child.className).value = child.innerHTML.replace(/^-$/, '')
}
}
})
document.getElementById('register-form').onsubmit = function()
{
api.register()

View file

@ -134,6 +134,7 @@ button
div.tag
{
display : inline-block;
cursor : pointer;
background-color: #eee;
color : #222;
box-shadow : 1px 1px 5px #000;