From cc63445ec1d33fae063b4dd02a75de1182a88ed1 Mon Sep 17 00:00:00 2001 From: Vedrana <vand@dtu.dk> Date: Tue, 22 Sep 2020 00:07:54 +0200 Subject: [PATCH] Fixed sidebar not opening --- about.html | 1 + example1.html | 1 + example2.html | 1 + example3.html | 1 + index.html | 2 ++ qim_repository_template.html | 1 + sidebar.html | 14 -------------- sidebar_functions.js | 10 ++++++++++ 8 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 sidebar_functions.js diff --git a/about.html b/about.html index f01f88b..5fba2d3 100644 --- a/about.html +++ b/about.html @@ -11,6 +11,7 @@ body,h1,h2,h3,h4,h5,h6 {font-family: "Raleway", sans-serif} </style> <link rel="shortcut icon" href="favicon.ico"> <script src="includeHTML.js"></script> +<script src="sidebar_functions.js"></script> <body class="w3-light-grey w3-content" style="max-width:1600px"> diff --git a/example1.html b/example1.html index 442e07f..dd2bb15 100644 --- a/example1.html +++ b/example1.html @@ -11,6 +11,7 @@ body,h1,h2,h3,h4,h5,h6 {font-family: "Raleway", sans-serif} </style> <link rel="shortcut icon" href="favicon.ico"> <script src="includeHTML.js"></script> +<script src="sidebar_functions.js"></script> <body class="w3-light-grey w3-content" style="max-width:1600px"> diff --git a/example2.html b/example2.html index c72e1da..88e2ed2 100644 --- a/example2.html +++ b/example2.html @@ -11,6 +11,7 @@ body,h1,h2,h3,h4,h5,h6 {font-family: "Raleway", sans-serif} </style> <link rel="shortcut icon" href="favicon.ico"> <script src="includeHTML.js"></script> +<script src="sidebar_functions.js"></script> <body class="w3-light-grey w3-content" style="max-width:1600px"> diff --git a/example3.html b/example3.html index b9beeb0..b7ded1a 100644 --- a/example3.html +++ b/example3.html @@ -11,6 +11,7 @@ body,h1,h2,h3,h4,h5,h6 {font-family: "Raleway", sans-serif} </style> <link rel="shortcut icon" href="favicon.ico"> <script src="includeHTML.js"></script> +<script src="sidebar_functions.js"></script> <body class="w3-light-grey w3-content" style="max-width:1600px"> diff --git a/index.html b/index.html index f8c434b..cb2c158 100644 --- a/index.html +++ b/index.html @@ -11,11 +11,13 @@ body,h1,h2,h3,h4,h5,h6 {font-family: "Raleway", sans-serif} </style> <link rel="shortcut icon" href="favicon.ico"> <script src="includeHTML.js"></script> +<script src="sidebar_functions.js"></script> <body class="w3-light-grey w3-content" style="max-width:1600px"> <!-- Sidebar/menu and --> <!-- Overlay effect when opening sidebar on small screens --> +<!-- Sidebar/menu --> <div w3-include-html="sidebar.html"></div> <!-- !PAGE CONTENT! --> diff --git a/qim_repository_template.html b/qim_repository_template.html index c5ef289..535ed87 100644 --- a/qim_repository_template.html +++ b/qim_repository_template.html @@ -11,6 +11,7 @@ body,h1,h2,h3,h4,h5,h6 {font-family: "Raleway", sans-serif} </style> <link rel="shortcut icon" href="favicon.ico"> <script src="includeHTML.js"></script> +<script src="sidebar_functions.js"></script> <body class="w3-light-grey w3-content" style="max-width:1600px"> diff --git a/sidebar.html b/sidebar.html index e84d7df..79507e2 100644 --- a/sidebar.html +++ b/sidebar.html @@ -21,17 +21,3 @@ <!-- Overlay effect when opening sidebar on small screens --> <div class="w3-overlay w3-hide-large w3-animate-opacity" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div> - - -<script> -// Script to open and close sidebar -function w3_open() { - document.getElementById("mySidebar").style.display = "block"; - document.getElementById("myOverlay").style.display = "block"; -} - -function w3_close() { - document.getElementById("mySidebar").style.display = "none"; - document.getElementById("myOverlay").style.display = "none"; -} -</script> diff --git a/sidebar_functions.js b/sidebar_functions.js new file mode 100644 index 0000000..a022188 --- /dev/null +++ b/sidebar_functions.js @@ -0,0 +1,10 @@ +// Script to open and close sidebar +function w3_open() { + document.getElementById("mySidebar").style.display = "block"; + document.getElementById("myOverlay").style.display = "block"; +}; + +function w3_close() { + document.getElementById("mySidebar").style.display = "none"; + document.getElementById("myOverlay").style.display = "none"; +}; -- GitLab