1/* Handles toggling the sidebar popout */ 2 3jQuery(document).ready(function ($) { 4 if($('.js-popout-sidebar').length > 0) { 5 $("body").on("click", ".js-popout-sidebar-toggle", function (e) { 6 e.preventDefault(); 7 8 let toggleElement = $(this); 9 let popoutElement = "#" + toggleElement.data('sidebar-id'); 10 11 if($(popoutElement).hasClass('open')) { 12 // Need to close this pop-out 13 $(popoutElement).removeClass('open'); 14 toggleElement.attr('aria-expanded', false); 15 } 16 else { 17 // First close all other pop-outs 18 $('.js-popout-sidebar').removeClass('open'); 19 $('.js-popout-sidebar-toggle').attr('aria-expanded', false); 20 21 // Then open this one 22 $(popoutElement).addClass('open'); 23 toggleElement.attr('aria-expanded', true); 24 25 // Set focus to the close button of the pop-out 26 setTimeout(function() { 27 $(popoutElement).find('.js-popout-sidebar-close').first().focus(); 28 }, 10); 29 } 30 }); 31 32 $("body").on("click", ".js-popout-sidebar-close", function (e) { 33 // Close This Sidebar, Reset All Triggers 34 let toggleElement = $(this); 35 let popOut = $(this).parents('.js-popout-sidebar').first(); 36 37 popOut.removeClass('open'); 38 $('.js-popout-sidebar-toggle').attr('aria-expanded', false); 39 }); 40 } 41});
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.