From b3d97ebb64af2aefc84e5e3c454d181776b0d96f 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. --- .../components/_related-navigation.scss | 8 ++++++++ .../components/related_navigation/_section.html.erb | 1 + 2 files changed, 9 insertions(+) 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 %>