mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-03 07:31:28 -04:00
Deal with lost focus when selection cleared
This was missed out of the work on improving focus on the templates page. When you clear the current selection, the 'clear' link disappears so focus needs to be sent somewhere.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
// first off show the new template / new folder buttons
|
||||
this.currentState = this.$form.data('prev-state') || 'unknown';
|
||||
if (this.currentState === 'unknown') {
|
||||
this.selectActionButtons(false);
|
||||
this.selectActionButtons();
|
||||
} else {
|
||||
this.render();
|
||||
}
|
||||
@@ -90,13 +90,14 @@
|
||||
};
|
||||
|
||||
this.addClearButton = function(state) {
|
||||
|
||||
let selector = 'button[value=add-new-template]';
|
||||
let $clear = this.makeButton('Clear', () => {
|
||||
|
||||
// uncheck all templates and folders
|
||||
this.$form.find('input:checkbox').prop('checked', false);
|
||||
|
||||
// go back to action buttons
|
||||
this.selectActionButtons();
|
||||
this.selectActionButtons(selector);
|
||||
});
|
||||
|
||||
state.$el.find('.template-list-selected-counter').append($clear);
|
||||
|
||||
Reference in New Issue
Block a user