Skip to content

Commit

Permalink
Merge pull request #354 from alphagov/use-hidden-not-css-for-expiry-n…
Browse files Browse the repository at this point in the history
…otices

Use hidden attribute to show/hide expiry notices
  • Loading branch information
tombye authored Sep 18, 2024
2 parents 8970435 + de4a27f commit 45d4cf8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Update gem dependencies.
- Declare some missing indirect dependencies to prepare for Ruby 3.4. This also resolves some warnings about this at build time.
- Remove aria-hidden from search label to let assistive technologies see its accessible name
- Use hidden attribute to show/hide expiry notices instead of just CSS

## 3.5.0

Expand Down
4 changes: 2 additions & 2 deletions lib/assets/javascripts/_modules/page-expiry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
var isExpired = Date.parse(rawDate) < new Date()

if (isExpired) {
$element.find('.page-expiry--not-expired').hide(0)
$element.find('.page-expiry--expired').show(0)
$element.find('.page-expiry--not-expired').attr('hidden', '')
$element.find('.page-expiry--expired').removeAttr('hidden')
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions lib/assets/stylesheets/modules/_page-review.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
}

.page-expiry--expired {
display: none;

padding: govuk-spacing(3);
margin-top: govuk-spacing(9);
border: govuk-spacing(1) solid $govuk-error-colour;
Expand Down
2 changes: 1 addition & 1 deletion lib/source/layouts/_page_review.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>

<% if current_page_review.show_expiry? %>
<div class='page-expiry--expired'>
<div class='page-expiry--expired' hidden>
This page was set to be reviewed before <%= format_date current_page_review.review_by %><% if current_page_review.owner_slack %>
by the page owner <%= link_to current_page_review.owner_slack, current_page_review.owner_slack_url %><% end %>.
This might mean the content is out of date.
Expand Down

0 comments on commit 45d4cf8

Please sign in to comment.