refactor: simplify css and ts layout
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
"use strict";
|
||||
// static/js/anime.ts
|
||||
(() => {
|
||||
const toggleDropdown = () => {
|
||||
const dropdown = document.getElementById('watchlist-dropdown');
|
||||
if (!dropdown) {
|
||||
return;
|
||||
}
|
||||
dropdown.classList.toggle('open');
|
||||
};
|
||||
window.toggleDropdown = toggleDropdown;
|
||||
document.addEventListener('click', (event) => {
|
||||
const dropdown = document.getElementById('watchlist-dropdown');
|
||||
if (!dropdown) {
|
||||
return;
|
||||
}
|
||||
const target = event.target;
|
||||
if (!(target instanceof Node)) {
|
||||
return;
|
||||
}
|
||||
if (!dropdown.contains(target)) {
|
||||
dropdown.classList.remove('open');
|
||||
}
|
||||
});
|
||||
const toggleDropdown = () => {
|
||||
const dropdown = document.getElementById("watchlist-dropdown");
|
||||
if (!dropdown) {
|
||||
return;
|
||||
}
|
||||
dropdown.classList.toggle("open");
|
||||
};
|
||||
window.toggleDropdown = toggleDropdown;
|
||||
document.addEventListener("click", (event) => {
|
||||
const dropdown = document.getElementById("watchlist-dropdown");
|
||||
if (!dropdown) {
|
||||
return;
|
||||
}
|
||||
const target = event.target;
|
||||
if (!(target instanceof Node)) {
|
||||
return;
|
||||
}
|
||||
if (!dropdown.contains(target)) {
|
||||
dropdown.classList.remove("open");
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user