add program tags interface to new block modal

This commit is contained in:
Sundog Jones 2024-09-23 13:50:51 -04:00
parent bbe87f1ead
commit 95564afa5c

View File

@ -966,23 +966,21 @@
} }
const block_tag_editor_handlers = () => { const block_tag_editor_handlers = () => {
const enabled_tags = document.querySelectorAll(".tag.enabled"); const tags = document.querySelectorAll("#new_block_program_tags > .tag");
const disabled_tags = document.querySelectorAll(".tag.disabled"); tags.forEach((tag) => {
tag.addEventListener("click", block_tag_editor_click_handler);
});
}
enabled_tags.forEach((tag) => { const block_tag_editor_click_handler = (e) => {
tag.addEventListener("click", (e) => {
e.preventDefault();
e.target.classList.remove('enabled');
e.target.classList.add('disabled');
});
});
disabled_tags.forEach((tag) => {
tag.addEventListener("click", (e) => {
e.preventDefault(); e.preventDefault();
if (e.target.classList.contains('disabled')) {
e.target.classList.remove('disabled'); e.target.classList.remove('disabled');
e.target.classList.add('enabled'); e.target.classList.add('enabled');
}); } else {
}); e.target.classList.remove('enabled');
e.target.classList.add('disabled');
}
} }
document.getElementById("epg_tab").addEventListener("click", (e) => { document.getElementById("epg_tab").addEventListener("click", (e) => {