PageSourceSearch

https://kurabokko.net/SHOP/js/drawer_menu.js

js kurabokko.net collected 2026-09-26 08:00:51 UTC 1,915 bytes, 76 lines download raw bytes

1var wrapperElement, subColumnElement, headerNavDrawerElement;
2var spsDrawerOpenClass = 'spsDrawerOpen';
3var spsDrawerCloseClass = 'spsDrawerClose';
4
5window.onload = function() {
6  headerNavDrawerElement = document.getElementById('header-nav-drawer');
7  wrapperElement = document.getElementById('wrapper');
8  subColumnElement = document.getElementById('sub-column');
9
10  hideSidebar();
11
12  if (headerNavDrawerElement && subColumnElement) {
13    headerNavDrawerElement.addEventListener('click', function(e) {
14      toggleDisplaySidebar();
15    });
16  }
17}
18
19function toggleDisplaySidebar() {
20  if (isSidebarShown()) {
21    hideSidebar();
22  } else {
23    showSidebar();
24  }
25}
26
27function isSidebarShown() {
28  if (subColumnElement) {
29    return subColumnElement.className === spsDrawerOpenClass;
30  }
31
32  return 0;
33}
34
35function showSidebar() {
36  if (subColumnElement) {
37    subColumnElement.className = spsDrawerOpenClass;
38  }
39
40  if (wrapperElement) {
41    wrapperElement.className = spsDrawerOpenClass;
42  }
43
44  if (headerNavDrawerElement) {
45    headerNavDrawerElement.className = spsDrawerOpenClass;
46  }
47
48  window.addEventListener('click', handleOutsideDrawer);
49  window.addEventListener('touchstart', handleOutsideDrawer, {passive: false});
50}
51
52function hideSidebar() {
53  if (subColumnElement) {
54    subColumnElement.className = spsDrawerCloseClass;
55  }
56
57  if (wrapperElement) {
58    wrapperElement.className = spsDrawerCloseClass;
59  }
60
61  if (headerNavDrawerElement) {
62    headerNavDrawerElement.className = spsDrawerCloseClass;
63  }
64
65  window.removeEventListener('click', handleOutsideDrawer);
66  window.removeEventListener('touchstart', handleOutsideDrawer, {passive: false});
67}
68
69function handleOutsideDrawer(e) {
70  if (!subColumnElement.contains(e.target) &&
71      !headerNavDrawerElement.contains(e.target) &&
72      !(e.target.className === 'prev' || e.target.className === 'next')) {
73    hideSidebar();
74    e.preventDefault();
75  }
76}

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.