Skip to content

Commit

Permalink
CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CPrich905 committed Sep 27, 2023
1 parent 3605d64 commit 0cbc7ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions common/static/common/js/buttonDebounce.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
let button = document.querySelectorAll('span.add-debounce > button')[0]
let button = document.getElementById('add-debounce')

const debounceButton = () => {
if (!button) {
return
} else if (button) {
if (button) {
console.log('button', button)
addEventListener('submit', function() {
button.disabled = true,
alert("Your action is being processed and the submit button is now disabled. You will be taken to a confirmation screen once the action has been processed.")}
Expand Down
4 changes: 2 additions & 2 deletions measures/jinja2/measures/create-review.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@
{% endif %}
{% endcall %}

<span class="add-debounce">{{ govukButton({"text": "Create", "preventDoubleClick": true, css_class:"test"}) }}</span>
{% endblock %}
{{ govukButton({"text": "Create", "preventDoubleClick": true, "attributes": {"id": "add-debounce"},}) }}
{% endblock %}

0 comments on commit 0cbc7ea

Please sign in to comment.