mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-17 12:29:20 -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:
@@ -197,6 +197,11 @@
|
||||
if (event.currentTarget.value === 'add-new-template' && this.$singleNotificationChannel) {
|
||||
window.location = "/services/" + this.$singleChannelService + "/templates/add-" + this.$singleNotificationChannel;
|
||||
} else {
|
||||
if (this.currentState === 'add-new-template') {
|
||||
this.$form.find('input[type=checkbox]').prop('checked', false);
|
||||
this.selectionStatus.update({ total: 0, templates: 0, folders: 0 });
|
||||
}
|
||||
|
||||
if (this.stateChanged()) {
|
||||
this.render();
|
||||
}
|
||||
@@ -286,7 +291,15 @@
|
||||
mode = 'dialog';
|
||||
}
|
||||
|
||||
if (currentStateObj && ('setFocus' in currentStateObj)) {
|
||||
if (this.currentState === 'add-new-template') {
|
||||
this.$form.find('.template-list-item').addClass('js-hidden');
|
||||
this.$form.find('input[type=checkbox]').prop('checked', false);
|
||||
this.selectionStatus.update({ total: 0, templates: 0, folders: 0 });
|
||||
} else {
|
||||
this.$form.find('.template-list-item').removeClass('js-hidden');
|
||||
}
|
||||
|
||||
if (currentStateObj && 'setFocus' in currentStateObj) {
|
||||
scrollTop = $(window).scrollTop();
|
||||
currentStateObj.setFocus();
|
||||
$(window).scrollTop(scrollTop);
|
||||
|
||||
Reference in New Issue
Block a user