Skip to content

Commit

Permalink
escape fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Jones committed Mar 8, 2024
1 parent 5825e02 commit b72e72f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 215 deletions.
15 changes: 15 additions & 0 deletions app/assets/js/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ servicesTab.addEventListener('click', function (event) {
}
});

document.addEventListener('keydown', function (event) {
// Check if the Escape key is pressed
if (event.key === "Escape" || event.key === "Esc") {
// Prevent the default action to avoid any side effects
event.preventDefault();

// Check if the servicesPanel is currently displayed
if (servicesPanel.style.display === 'block') {
servicesPanel.style.display = 'none';
servicesPanel.setAttribute('aria-hidden', 'true');
servicesTab.setAttribute('aria-expanded', 'false');
}
}
});

closeNav.addEventListener('click', function (event) {
event.preventDefault();

Expand Down
4 changes: 2 additions & 2 deletions app/views/design-system/components/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ <h2 class="govuk-header-l">Published components</h2>

<div class="dfe-card">
<div class="dfe-card-container">
<h2 class="govuk-heading-m">
<h3 class="govuk-heading-m">
<a href="/design-system/components/header"
class="govuk-link govuk-link--no-visited-state dfe-card-link--header">Header</a>
</h2>
</h3>
<p>Use the DfE header on internal services or those hosted on education.gov.uk</p>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/design-system/patterns/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ <h2 class="govuk-header-l">Published patterns</h2>

<div class="dfe-card">
<div class="dfe-card-container">
<h2 class="govuk-heading-m">
<h3 class="govuk-heading-m">
<a href="/design-system/patterns/select-a-school"
class="govuk-link govuk-link--no-visited-state dfe-card-link--header">Select a school</a>
</h2>
</h3>
<p>A pattern for selecting a school from the list of all schools in England.</p>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/design-system/styles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ <h1 class="govuk-heading-xl govuk-!-margin-top-6">{{pageName}}</h1>

<div class="dfe-card">
<div class="dfe-card-container">
<h2 class="govuk-heading-m">
<h3 class="govuk-heading-m">
<a href="/design-system/styles/colour"
class="govuk-link govuk-link--no-visited-state dfe-card-link--header">Colour</a>
</h2>
</h3>
<p>Colour palette for Department for Education services.</p>
</div>
</div>

<div class="dfe-card">
<div class="dfe-card-container">
<h2 class="govuk-heading-m">
<h3 class="govuk-heading-m">
<a href="/design-system/styles/typography"
class="govuk-link govuk-link--no-visited-state dfe-card-link--header">Typography</a>
</h2>
</h3>
<p>Font family and styles for Department for Education services.</p>
</div>
</div>
Expand Down
206 changes: 0 additions & 206 deletions app/views/index copy.html

This file was deleted.

2 changes: 1 addition & 1 deletion public/assets/js/feedback.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b72e72f

Please sign in to comment.