mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-15 23:37:59 -04:00
Cleanup
This commit is contained in:
parent
5fce8b0257
commit
19cc42926d
@ -1630,15 +1630,10 @@ function attachArticleListEventListeners (findDirEntryCallback, appstate) {
|
||||
}
|
||||
// Set a delay before expanding (e.g., 400ms)
|
||||
hoverTimeout = setTimeout(function () {
|
||||
// Safety check: ensure the element still has the expected children
|
||||
if (element.children.length < 2) return;
|
||||
var header = element.children[0];
|
||||
var content = element.children[1];
|
||||
var isExpanded = header.getAttribute('aria-expanded') === 'true';
|
||||
// Only expand if not already expanded
|
||||
if (!isExpanded) {
|
||||
content.classList.remove('collapsed');
|
||||
header.setAttribute('aria-expanded', 'true');
|
||||
// Only toggle if the element is not expanded
|
||||
if (element.children[1] && element.children[1].classList.contains('collapsed')) {
|
||||
// Expand the snippet
|
||||
toggleSnippet(element, null);
|
||||
}
|
||||
}, 400);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user