mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-05 14:11:41 -04:00
- 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:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user