-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:nationalarchives/tna-frontend into …
…feature/hero-captions
- Loading branch information
Showing
20 changed files
with
264 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,6 @@ module.exports = { | |
return config; | ||
}, | ||
docs: { | ||
autodocs: false, | ||
autodocs: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 0 additions & 51 deletions
51
src/nationalarchives/assets/images/tna-horizontal-logo-inverted.svg
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
src/nationalarchives/assets/images/tna-horizontal-logo.svg
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export class SkipLink { | ||
linkedElementListener = false; | ||
|
||
constructor($module) { | ||
this.$module = $module; | ||
this.linkedElementId = $module.getAttribute("href").split("#").pop(); | ||
this.$linkedElement = | ||
$module && | ||
this.linkedElementId && | ||
document.getElementById(this.linkedElementId); | ||
} | ||
|
||
init() { | ||
if (!this.$module || !this.$linkedElement) { | ||
return; | ||
} | ||
this.$module.addEventListener("click", () => this.focusLinkedElement()); | ||
} | ||
|
||
focusLinkedElement() { | ||
if (!this.$linkedElement.getAttribute("tabindex")) { | ||
this.$linkedElement.setAttribute("tabindex", "-1"); | ||
this.$linkedElement.classList.add("tna-!--no-focus-style"); | ||
|
||
if (!this.linkedElementListener) { | ||
this.$linkedElement.addEventListener("blur", () => | ||
this.removeFocusProperties(), | ||
); | ||
this.linkedElementListener = true; | ||
} | ||
} | ||
|
||
this.$linkedElement.focus(); | ||
} | ||
|
||
removeFocusProperties() { | ||
this.$linkedElement.removeAttribute("tabindex"); | ||
this.$linkedElement.classList.remove("tna-!--no-focus-style"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{%- set containerClasses = [params.classes] if params.classes else [] -%} | ||
<a href="#{{ params.href if params.href else 'main-content' }}" class="tna-skip-link {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
<a href="#{{ params.href if params.href else 'main-content' }}" class="tna-skip-link {{ containerClasses | join(' ') }}" data-module="tna-skip-link" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
{{ params.text if params.text else 'Skip to main content' }} | ||
</a> |
Oops, something went wrong.