From 86cf2ab8362ca1fd31073fb4080cf6c623c769cb Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Thu, 15 Jun 2023 15:15:37 -0400 Subject: [PATCH] Fixing the issue of the template area buttons not working --- app/assets/javascripts/templateFolderForm.js | 18 ++++++------- .../uswds/_uswds-theme-custom-styles.scss | 27 +++++++++++++++++++ app/templates/components/folder-path.html | 4 +-- .../views/templates/_template_list.html | 6 ++--- tests/javascripts/templateFolderForm.test.js | 16 +++++------ 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/app/assets/javascripts/templateFolderForm.js b/app/assets/javascripts/templateFolderForm.js index dfef5a144..f2b54d864 100644 --- a/app/assets/javascripts/templateFolderForm.js +++ b/app/assets/javascripts/templateFolderForm.js @@ -82,7 +82,7 @@ this.render(); } - this.$form.on('click', 'button.usa-button', (event) => this.actionButtonClicked(event)); + this.$form.on('click', 'button.usa-button--event', (event) => this.actionButtonClicked(event)); this.$form.on('change', 'input[type=checkbox]', () => this.templateFolderCheckboxChanged()); }; @@ -91,7 +91,7 @@ $.each(this.states.filter(state => 'description' in state), (idx, state) => { id = `${state.key}__description`; - description = `

${state.description}

`; + description = `

${state.description}

`; state.$el .prepend(description) .attr('aria-describedby', id); @@ -149,7 +149,7 @@ this.makeButton = (text, opts) => { let $btn = $('') .html(text) - .addClass('usa-link font-body-sm margin-left-1 js-cancel') + .addClass('usa-link js-cancel') // isn't set if cancelSelector is undefined .data('target', opts.cancelSelector || undefined) .attr('tabindex', '0') @@ -162,7 +162,7 @@ }); if (opts.hasOwnProperty('nonvisualText')) { - $btn.append(` ${opts.nonvisualText}`); + $btn.append(` ${opts.nonvisualText}`); } return $btn; @@ -299,10 +299,10 @@ this.nothingSelectedButtons = $(`
- - +