A small patch to address one of the issues in bug
1615707. This adds a
skip link above the staff nav bar. When it has focus, it's visible and
sits on top of the regular navigation links. Otherwise, it's placed off
the canvas.
Updated to simplify the routing approach and add a missing page title
(used as the skip destination anchor).
It would be great to customize the text of the link to specify the
context. For example, the bookshare.org search results skip link reads
"Skip to 1 through 7 of 7 search results." That will be more complicated
to implement though, and this wording is a common and accepted pattern.
This patch covers only Angular screens. A separate patch will be needed
for AngularJS.
Signed-off-by: Stephanie Leary <stephanie.leary@equinoxOLI.org>
@NgModule({
imports: [RouterModule.forRoot(routes, {
onSameUrlNavigation: 'reload',
- relativeLinkResolution: 'legacy'
+ relativeLinkResolution: 'legacy',
+ anchorScrolling: 'enabled'
})],
exports: [RouterModule],
providers: [BaseResolver]
+<ng-container *ngIf="identType === 'id'">
+ <eg-staff-banner bannerText="Search by Record ID" i18n-bannerText>
+ </eg-staff-banner>
+</ng-container>
+
+<ng-container *ngIf="identType === 'tcn'">
+ <eg-staff-banner bannerText="Search by Record TCN" i18n-bannerText>
+ </eg-staff-banner>
+</ng-container>
+
<div class="row form-validated mt-5">
<div class="col-lg-6 form-inline">
+a.skip-nav:not(:focus):not(:hover) {
+ transform: translateY(-4em);
+ opacity: 0;
+}
+
+a.skip-nav {
+ background-color: #fff;
+ border: 1px solid #0D7764;
+ color: #0D7764;
+ margin: 0;
+ padding: 1em;
+ position: absolute;
+ z-index: 2000;
+ left: 0;
+ top: 0;
+ width: auto;
+ transition: transform 0.15s ease-out, opacity 0.15s ease-out;
+}
+
/* remove dropdown carret for icon-based entries */
#staff-navbar .no-caret::after {
display:none;
+<a i18n class="skip-nav" [routerLink]="" [fragment]="'staff-banner'">Skip to main content</a>
+
<div id="staff-navbar" class="navbar fixed-top navbar-expand navbar-default">
<div class="collapse navbar-collapse">
<div class="navbar-nav">
<div class="lead alert alert-primary text-center pt-1 pb-1"
[ngClass]="bannerStyle ? bannerStyle : 'alert-primary'">
- <h1>
+ <h1 id="staff-banner" tabindex="0">
<i class="material-icons align-middle text-left" *ngIf="bannerIcon">{{bannerIcon}}</i>
<span i18n>{{bannerText}}</span>
</h1>
}
</style>
-<h1 class="sr-only" i18n>Evergreen Staff Client Home Page</h1>
+<h1 class="sr-only" id="staff-banner" tabindex="0" i18n>Evergreen Staff Client Home Page</h1>
<eg-title i18n-prefix prefix="Evergreen Staff Client"></eg-title>