feat: hide subsequent sections based on activity script presence

Enhance the visibility control of sections by adding a check for
'script[data-activity-id]'. If a section contains such a script,
all following sections will be hidden to improve user focus and
interface clarity.
This commit is contained in:
Kumi 2024-09-23 09:17:45 +02:00
parent dba761ac70
commit bf9cc7445b
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -211,6 +211,13 @@
$(currentScript).closest("li.section").attr("id")
);
});
sections.each(function (index) {
if ($(this).find('script[data-activity-id]').length > 0) {
// Hide all .section elements after this one
sections.slice(index + 1).css('visibility', 'hidden');
}
});
})
})
.catch((error) => {