From 6638993e5e89826f8bcf31563a636d83768f6240 Mon Sep 17 00:00:00 2001 From: Michael Della Bitta Date: Wed, 21 Feb 2024 20:20:12 +0000 Subject: [PATCH] Fixes two anchor links. Uses animiation frame hack to make cold urls that target hash tags work. (#74) --- src/templates/cap-about-page.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/templates/cap-about-page.js b/src/templates/cap-about-page.js index 095f419..ac08890 100644 --- a/src/templates/cap-about-page.js +++ b/src/templates/cap-about-page.js @@ -184,7 +184,9 @@ export class CapAboutPage extends LitElement { if (hash) { const element = this.shadowRoot.getElementById(hash); if (element) { - element.scrollIntoView(); + // wait a beat for things to draw. + window.requestAnimationFrame(() => {}); + window.requestAnimationFrame(() => element.scrollIntoView()); } } } @@ -236,7 +238,9 @@ export class CapAboutPage extends LitElement {

Data sources

-

Harvard Law School Collection

+

+ Harvard Law School Collection +

We created CAP's initial collection by digitizing roughly 40 million pages of court decisions contained in roughly 40,000 bound volumes @@ -283,7 +287,7 @@ export class CapAboutPage extends LitElement { copyright. -

Fastcase Collection

+

Fastcase Collection

Our collection is augmented with yearly caselaw donations courtesy of @@ -362,7 +366,7 @@ export class CapAboutPage extends LitElement { Have you used Caselaw Access Project data in your research? Tell us about it.

-

+

Usage and Access