PageSourceSearch

https://www.coronationroll.gov.uk/wp-content/themes/coronation-roll-govuk/js/sidebar.js

js coronationroll.gov.uk collected 2026-10-02 13:50:39 UTC 1,770 bytes, 60 lines download raw bytes

1// main sidebar
2const sidebarToggle = document.querySelector('.tcr-menu-button-toggle');
3const sidebarPanel = document.querySelector('.tcr-main-menu-sidebar');
4const sidebarClose = document.querySelector('.tcr-main-menu-sidebar .tcr-close-button');
5
6sidebarToggle.addEventListener('click', () => {
7  openSidebar();
8});
9
10sidebarClose.addEventListener('click', () => {
11    sidebarToggle.setAttribute('aria-expanded', "false");
12    closeSidebar();
13});
14
15document.addEventListener('keydown', (event) => {
16    if (event.key === 'Escape') {
17        closeSidebar();
18        closeSidebarJQuery();
19    }
20});
21
22function openSidebar() {
23    sidebarToggle.setAttribute('aria-expanded', "true");
24    sidebarPanel.setAttribute('data-state', "opened");
25}
26
27function closeSidebar() {
28    sidebarToggle.setAttribute('aria-expanded', "false");
29    sidebarPanel.setAttribute('data-state', "closing");
30
31    sidebarPanel.addEventListener('animationend', () => {
32        sidebarPanel.setAttribute('data-state', "closed");
33    }, {once: true})
34}
35
36// JQuery
37$(".tcr-menu-button-toggle").click(function () {
38    $(".tcr-main-menu-sidebar").show();
39    $(".tcr-black-overlay").addClass("overlay-level-3");
40    $(".tcr-black-overlay").fadeIn(300);
41    $(".tcr-main-menu-sidebar").animate({left: "0"}, 300);
42});
43
44$(".tcr-main-menu-sidebar .tcr-close-button").click(function () {
45    closeSidebarJQuery();
46});
47
48$(".tcr-main-menu-sidebar a").click(function () {
49    closeSidebarJQuery();
50});
51
52function closeSidebarJQuery() {
53    $.when(
54        $(".tcr-black-overlay").fadeOut(300),
55        $(".tcr-main-menu-sidebar").animate({left: "-540px"}, 300)
56    ).done(function () {
57        $(".tcr-black-overlay").removeClass("overlay-level-3");
58        $(".tcr-main-menu-sidebar").delay(300).hide();
59    });
60}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.