Skip to content

Commit

Permalink
LSMA-9198 fix focus and add reset msg
Browse files Browse the repository at this point in the history
  • Loading branch information
mrw-iu committed Mar 25, 2024
1 parent 05e01d9 commit 9152314
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/main/resources/static/js/crosslisting.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ $(document).ready(function(){
var submitButton = $('#continue-button');
submitButton.attr("disabled", true);
submitButton.attr("aria-disabled", true);

// move focus back to the reset button and announce reset
$(this).focus();
$('#resetMsg').text('Changes reset.');
});

/* Continue Button, submits the form */
Expand Down Expand Up @@ -251,6 +255,8 @@ jQuery.fn.preventDoubleSubmission = function() {

function checkboxEventRegistration() {
$('.sectionsList :checkbox').on('click', function(event) {
// make sure the "reset" msg is cleared out since there is a new change
$('#resetMsg').text('');

var currentBox = $(this);
var li = currentBox.parent().parent();
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h2 class="rvt-sr-only">View additional terms</h2>
</div>

<div class="rvt-button-group rvt-button-group--right rvt-m-top-sm rvt-vertical-center">
<button id="reset-button" class="rvt-button rvt-button--secondary" type="button" >Reset</button>
<button id="reset-button" class="rvt-button rvt-button--secondary" type="button">Reset</button>

<button id="continue-button" class="rvt-button" type="submit" th:disabled="${editMode == null || !editMode}">
<span class="rvt-button__content">Continue</span>
Expand All @@ -140,7 +140,10 @@ <h2 class="rvt-sr-only">View additional terms</h2>
<span class="loading-text rvt-sr-only rvt-display-none">Loading summary of changes</span>
</span>
</button>
</div>

<div aria-live="polite">
<span id="resetMsg" class="rvt-sr-only"></span>
</div>
</form>
<form id="show-crosslisted-in-other-sections-form" th:object="${impersonationModel}" th:action="@{|/app/${courseId}/selfimpersonate|}" method="post">
Expand Down

0 comments on commit 9152314

Please sign in to comment.