Compare commits
1 Commits
a1e11c10d4
...
7ba0f349ec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ba0f349ec |
@@ -681,13 +681,9 @@ document.body.addEventListener("htmx:responseError", function (event) {
|
||||
|
||||
document.addEventListener('toggle', function (event) {
|
||||
const details = event.target;
|
||||
console.log('toggle fired on', details.tagName, 'open=', details.open);
|
||||
|
||||
// Only act on <details> elements that were just opened
|
||||
if (details.tagName !== 'DETAILS' || !details.open) return;
|
||||
|
||||
console.log('details opened – closing children');
|
||||
|
||||
// Close any child <details> that are open
|
||||
details.querySelectorAll('details[open]').forEach(function (child) {
|
||||
if (child !== details) {
|
||||
@@ -824,19 +820,3 @@ document.body.addEventListener('htmx:beforeSwap', function (event) {
|
||||
});
|
||||
|
||||
|
||||
document.body.addEventListener('htmx:beforeSwap', function(evt) {
|
||||
console.log('HTMX beforeSwap:', {
|
||||
hasSearch: !!document.getElementById('search-desktop'),
|
||||
target: evt.detail.target,
|
||||
requestURL: evt.detail.xhr?.responseURL,
|
||||
swapStyle: evt.detail.swapStyle,
|
||||
serverResponse: evt.detail.serverResponse.substring(0, 200) + '...'
|
||||
});
|
||||
});
|
||||
|
||||
document.body.addEventListener('htmx:afterSwap', function(evt) {
|
||||
console.log('HTMX afterSwap:', {
|
||||
target: evt.detail.target,
|
||||
hasSearch: !!document.getElementById('search-desktop')
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user