diff options
| author | Bobby <[email protected]> | 2025-12-29 10:46:00 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-12-29 10:46:00 +0530 |
| commit | f59ca1976a1075e9e8fdf1e5fcdb7cfc853493b8 (patch) | |
| tree | 1123c3d0785a44261151bc46f2b38a4db9eb57b7 /static/js/dropdown.js | |
| parent | cccf44496a056d15d5d86d9fbd74633f21e852bb (diff) | |
| download | lain-f59ca1976a1075e9e8fdf1e5fcdb7cfc853493b8.tar.xz lain-f59ca1976a1075e9e8fdf1e5fcdb7cfc853493b8.zip | |
feat: Enhance email viewer with new UI actions, sender profile pictures, and raw header display.
Diffstat (limited to 'static/js/dropdown.js')
| -rw-r--r-- | static/js/dropdown.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/static/js/dropdown.js b/static/js/dropdown.js index 00b7ee6..80efd19 100644 --- a/static/js/dropdown.js +++ b/static/js/dropdown.js @@ -1,11 +1,12 @@ document.addEventListener('DOMContentLoaded', function () { - // Handle dropdown clicks - document.querySelectorAll('.options-subitem > a').forEach(function (item) { - item.addEventListener('click', function (e) { + document.addEventListener('click', function (e) { + const toggleLink = e.target.closest('a'); + + if (toggleLink && toggleLink.parentElement && toggleLink.parentElement.classList.contains('options-subitem')) { e.preventDefault(); - const parent = this.parentElement; + const parent = toggleLink.parentElement; - if (parent.classList.contains('disabled')) { + if (parent.classList.contains('disabled') || parent.getAttribute('disabled') !== null) { return; } @@ -16,11 +17,10 @@ document.addEventListener('DOMContentLoaded', function () { }); parent.classList.toggle('open'); - }); - }); + return; + } - // Close dropdowns when clicking outside - document.addEventListener('click', function (e) { + // Handle clicking outside if (!e.target.closest('.options-subitem')) { document.querySelectorAll('.options-subitem.open').forEach(function (item) { item.classList.remove('open'); |
