mirror of
https://github.com/SilenceLurker/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 08:55:50 +00:00
Update bindings.js
This commit is contained in:
@@ -436,25 +436,19 @@ export function bindModalEvents() {
|
||||
const container = $("#amily2_drawer_content").length ? $("#amily2_drawer_content") : $("#amily2_chat_optimiser");
|
||||
|
||||
// Collapsible sections logic
|
||||
container.on('click touchend', '.collapsible-legend', function(e) {
|
||||
container.find('.collapsible-legend').each(function() {
|
||||
$(this).on('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
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 icon = legend.find('.collapse-icon');
|
||||
|
||||
const isCollapsed = content.is(':visible');
|
||||
const isCurrentlyVisible = content.is(':visible');
|
||||
const isCollapsedAfterClick = isCurrentlyVisible;
|
||||
|
||||
if (isCollapsed) {
|
||||
if (isCollapsedAfterClick) {
|
||||
content.hide();
|
||||
icon.removeClass('fa-chevron-up').addClass('fa-chevron-down');
|
||||
} else {
|
||||
@@ -466,9 +460,10 @@ export function bindModalEvents() {
|
||||
if (!extension_settings[extensionName]) {
|
||||
extension_settings[extensionName] = {};
|
||||
}
|
||||
extension_settings[extensionName][`collapsible_${sectionId}_collapsed`] = isCollapsed;
|
||||
extension_settings[extensionName][`collapsible_${sectionId}_collapsed`] = isCollapsedAfterClick;
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
});
|
||||
|
||||
displayDailyAuthCode();
|
||||
function updateModelInputView() {
|
||||
|
||||
Reference in New Issue
Block a user