Update bindings.js

This commit is contained in:
2025-10-30 16:45:18 +08:00
committed by GitHub
parent 0f9460cbe4
commit 19805feb97

View File

@@ -427,8 +427,19 @@ export function bindModalEvents() {
const container = $("#amily2_drawer_content").length ? $("#amily2_drawer_content") : $("#amily2_chat_optimiser"); const container = $("#amily2_drawer_content").length ? $("#amily2_drawer_content") : $("#amily2_chat_optimiser");
// Collapsible sections logic // Collapsible sections logic
container.on('click', '.collapsible-legend', function() { container.on('click touchend', '.collapsible-legend', function(e) {
e.preventDefault();
e.stopPropagation();
const legend = $(this); const legend = $(this);
// Debounce to prevent double firing on touch devices
const now = Date.now();
const lastTouch = legend.data('lastTouch') || 0;
if (now - lastTouch < 500) {
return;
}
legend.data('lastTouch', now);
const content = legend.siblings('.collapsible-content'); const content = legend.siblings('.collapsible-content');
const icon = legend.find('.collapse-icon'); const icon = legend.find('.collapse-icon');