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 enabled_tags = document.querySelectorAll(".tag.enabled");
const disabled_tags = document.querySelectorAll(".tag.disabled");
const tags = document.querySelectorAll("#new_block_program_tags > .tag");
tags.forEach((tag) => {
tag.addEventListener("click", block_tag_editor_click_handler);
});
}
enabled_tags.forEach((tag) => {
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.target.classList.remove('disabled');
e.target.classList.add('enabled');
});
});
const block_tag_editor_click_handler = (e) => {
e.preventDefault();
if (e.target.classList.contains('disabled')) {
e.target.classList.remove('disabled');
e.target.classList.add('enabled');
} else {
e.target.classList.remove('enabled');
e.target.classList.add('disabled');
}
}
document.getElementById("epg_tab").addEventListener("click", (e) => {