From e85ac2691f63b9be16e54dd8119141fdce07bf78 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Mon, 1 Oct 2018 14:39:16 +0000 Subject: [PATCH] Hide toggle link when JS disabled (related nav) When JS is disabled, we want to expand all content normally hidden behind a toggle, and hide the toggle link. --- CHANGELOG.md | 4 ++++ .../components/_related-navigation.scss | 8 ++++++++ .../components/related_navigation/_section.html.erb | 1 + 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a751046e2b..5c6a07fb65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ useful summary for people upgrading their application, not a replication of the commit log. +## Unreleased + +* Fix toggle behaviour in related navigation and taxonomy navigation when JS disabled (PR #551) + ## 11.1.0 * Add Admin analytics script (#555) diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss b/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss index 622df913ec..053480ceaa 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss @@ -36,6 +36,14 @@ } } +.gem-c-related-navigation__toggle { + display: none; + + .js-enabled & { + display: block; + } +} + .gem-c-related-navigation__section-link { @include bold-16; } diff --git a/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb b/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb index d3677d9803..e391a2eed2 100644 --- a/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +++ b/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb @@ -44,6 +44,7 @@ <% if links.length > section_link_limit %>