From 9c8fba45c8473f37176a229fdd6ee528cd558c97 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Wed, 20 Jul 2022 11:38:52 +0100 Subject: [PATCH 1/4] Stop using sticky JS on HTML publications - we've got a custom script on publications like /government/publications/heatwave-plan-for-england/beat-the-heat-staying-safe-in-hot-weather that keeps the contents list in the sidebar on the right as the page is scrolled - this script has a bug that lets the contents overlap the content at the bottom of the page in some situations - and we don't need the complexity of the JS now that CSS can do this natively - this isn't supported in Internet Explorer, but it fails gracefully --- .../stylesheets/views/_html-publication.scss | 5 +++++ .../content_items/html_publication.html.erb | 18 ++++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/views/_html-publication.scss b/app/assets/stylesheets/views/_html-publication.scss index e7390bcbb..0dc746624 100644 --- a/app/assets/stylesheets/views/_html-publication.scss +++ b/app/assets/stylesheets/views/_html-publication.scss @@ -22,6 +22,11 @@ } .contents-list-container { + @include govuk-media-query($from: desktop) { + position: sticky; + top: govuk-spacing(2); + } + .direction-rtl & { float: right; } diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb index 496e0f2a9..64994598d 100644 --- a/app/views/content_items/html_publication.html.erb +++ b/app/views/content_items/html_publication.html.erb @@ -49,11 +49,7 @@ type: @content_item.schema_name } %> -