From 351b6638a205fef4af876b07584f50ca6dd59317 Mon Sep 17 00:00:00 2001 From: Stephanie Leary Date: Wed, 2 Nov 2022 15:27:40 -0500 Subject: [PATCH] LP1615707 Skip link for staff navigation 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 --- Open-ILS/src/eg2/src/app/routing.module.ts | 3 ++- .../eg2/src/app/staff/cat/bib-by-ident.component.html | 10 ++++++++++ Open-ILS/src/eg2/src/app/staff/nav.component.css | 19 +++++++++++++++++++ Open-ILS/src/eg2/src/app/staff/nav.component.html | 2 ++ .../eg2/src/app/staff/share/staff-banner.component.ts | 2 +- Open-ILS/src/eg2/src/app/staff/splash.component.html | 2 +- 6 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/routing.module.ts b/Open-ILS/src/eg2/src/app/routing.module.ts index 9385e996af..555e2c53a2 100644 --- a/Open-ILS/src/eg2/src/app/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/routing.module.ts @@ -23,7 +23,8 @@ const routes: Routes = [ @NgModule({ imports: [RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload', - relativeLinkResolution: 'legacy' + relativeLinkResolution: 'legacy', + anchorScrolling: 'enabled' })], exports: [RouterModule], providers: [BaseResolver] diff --git a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html index b60e78d611..834e7ccb6d 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html @@ -1,3 +1,13 @@ + + + + + + + + + +
diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.css b/Open-ILS/src/eg2/src/app/staff/nav.component.css index 2df005a88a..3995e4c4e6 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.css +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.css @@ -1,3 +1,22 @@ +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; diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.html b/Open-ILS/src/eg2/src/app/staff/nav.component.html index 397753a46e..db0376ea29 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.html +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.html @@ -1,3 +1,5 @@ +Skip to main content +