Skip to content

Commit

Permalink
Merge pull request #26 from SU-SWS/FMS-7--a11y-focus
Browse files Browse the repository at this point in the history
FMS-7:  a11y focus
  • Loading branch information
jenbreese authored Nov 6, 2024
2 parents 505b0f3 + b465b57 commit 69a0c40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/css/bondholders.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions src/js/bondholders_subtheme.behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// disclaimer cookie policy
var overlayHtml =

'<div class="cookie-overlay p-4 d-block" role="dialog" style="visibility:hidden;" aria-labelledby="d-title" aria-describedby="description">' +
'<div class="cookie-overlay p-4 d-block" role="dialog" aria-modal="true" style="visibility:hidden;" aria-labelledby="d-title" aria-describedby="description">' +
'<div class="d-flex" id="description">' +

'<p id="dislaimer-intro">Please read the Disclaimer below and indicate your acceptance before entering the <strong>Office of the Treasurer</strong> website with information for bondholders and the Stanford community.</p>' +
Expand All @@ -31,8 +31,7 @@
'</div>' +
'</div>';

$(overlayHtml).insertBefore('#page-content')
.attr('tabindex', '-1');
$(overlayHtml).insertBefore('.dialog-off-canvas-main-canvas');

var capture = $('#description');

Expand Down Expand Up @@ -72,21 +71,21 @@
}
});

$('.su-multi-menu, .page-content, footer').addClass('d-background').attr('aria-hidden', 'true');
$('.dialog-off-canvas-main-canvas').attr('aria-hidden', 'true').addClass('d-background');

$('.cookie-overlay').css('visibility', '');

// If the cookie is already accepted.
if (document.cookie.split(';').some((item) => item.trim().startsWith('accepted_disclaimer=yes'))) {
$('.cookie-overlay').removeClass('d-block').addClass('d-none').css('visibility', 'hidden');
$('.su-multi-menu, .page-content, footer').removeClass('d-background').attr('aria-hidden', 'false');
$('.dialog-off-canvas-main-canvas').removeClass('d-background').attr('aria-hidden', 'false');
}

// Set the cookie
$('.accept-cookies').on('click', function () {
document.cookie = 'accepted_disclaimer=yes; Max-Age=86400; path=/; secure;';
$('.cookie-overlay').removeClass('d-block').addClass('d-none').css('visibility', 'visible');
$('.su-multi-menu, .page-content, footer').removeClass('d-background').attr('aria-hidden', 'false');
$('.dialog-off-canvas-main-canvas').removeClass('d-background').attr('aria-hidden', 'false');
});
},
};
Expand Down
7 changes: 3 additions & 4 deletions src/scss/components/_pop-up.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
@include padding(100px);

position: absolute;
top: 110px;
background: $su-color-white;
z-index: 2051;
z-index: 99999;
min-height: fit-content;
box-shadow: 0 2px 3px -1px rgba(0, 0, 0, 0.5);

Expand All @@ -34,7 +33,7 @@
}

button {
&:focus,
&:focus,
&:hover {
outline: 3px solid $su-color-black-20;
}
Expand All @@ -45,7 +44,7 @@
opacity: 0.1;
background-color: $su-color-black-10;

a,
a,
button {
pointer-events: none;
cursor: default;
Expand Down

0 comments on commit 69a0c40

Please sign in to comment.