Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMS-7: a11y focus #26

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading