- Clears any selected checkboxes to prevent form submission issues

- Fix search functionality to respect .template-list-item-hidden-by-default
- Add missing "No templates found" message to template search
- Ensure nested template items remain hidden when searching and clearing search
- Hides all template items when clicking "New template" button
- Shows everything again when exiting the "new template" state
This commit is contained in:
Beverly Nguyen
2025-06-09 16:35:01 -07:00
parent 8232d4ca21
commit fa158cd762
4 changed files with 32 additions and 8 deletions

View File

@@ -20,7 +20,6 @@
$targets.each(function() {
let content = $('.live-search-relevant', this).text() || $(this).text();
let isMatch = normalize(content).indexOf(normalize(query)) > -1;
if ($(this).has(':checked').length) {
$(this).show();
@@ -29,21 +28,25 @@
}
if (query == '') {
$(this).css('display', '');
$(this).removeClass('js-hidden');
results++;
return;
}
$(this).toggle(isMatch);
if (isMatch) { results++; }
let isMatch = normalize(content).includes(normalize(query));
if (isMatch) {
$(this).removeClass('js-hidden');
results++;
} else {
$(this).addClass('js-hidden');
}
});
if (query !== '' && results === 0) {
$noResultsMessage.show();
$noResultsMessage.removeClass('js-hidden');
} else {
$noResultsMessage.hide();
$noResultsMessage.addClass('js-hidden');
}
if (state === 'loaded') {