Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/darshanbaral/kitab.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Baral <darshanbaral@gmail.com>2019-06-17 06:49:55 +0300
committerDarshan Baral <darshanbaral@gmail.com>2019-06-17 06:49:55 +0300
commit183dd795bd887933e5454d54ec634ac97b0a52ef (patch)
tree49e5be0d34e9bd1d3fa4cee72808a6785726f162
parent683dd50da1b27c35e30aa677cd088b7ad56353cf (diff)
Consolidated script
-rw-r--r--layouts/partials/bookMenu.html4
-rw-r--r--layouts/partials/chapterMenu.html4
-rw-r--r--layouts/partials/header.html22
-rw-r--r--static/js/myFunctions.js18
4 files changed, 22 insertions, 26 deletions
diff --git a/layouts/partials/bookMenu.html b/layouts/partials/bookMenu.html
index 7b57e43..12db4e9 100644
--- a/layouts/partials/bookMenu.html
+++ b/layouts/partials/bookMenu.html
@@ -14,9 +14,9 @@
overflow: hidden;"
>
<div class="p-2">
- <b>
+ <strong>
Books
- </b>
+ </strong>
<ul class="list-unstyled ml-1">
{{ range .Site.Sections }}
<li class="hanging">
diff --git a/layouts/partials/chapterMenu.html b/layouts/partials/chapterMenu.html
index ffd1c01..7d719a3 100644
--- a/layouts/partials/chapterMenu.html
+++ b/layouts/partials/chapterMenu.html
@@ -15,12 +15,12 @@
overflow: hidden;"
>
<div class="p-2 rounded">
- <b class="mt-3">
+ <strong class="mt-3">
{{ $thisSection := .Site.GetPage "section" .Section }}
{{ with $thisSection }}
{{ .Title | markdownify }}
{{ end }}
- </b>
+ </strong>
<ul class="list-unstyled ml-1">
{{ $mypages := intersect (where .Site.Pages "Section" .Section) (where .Site.Pages "Kind" "page") }}
{{ range $mypages }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 7e76126..ced866e 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -12,25 +12,3 @@
</div>
</div>
</nav>
-<script>
- let expandMenu = function(x) {
- Array.from(document.querySelectorAll(".hover-menu")).forEach(hovermenu => {
- hovermenu.nextElementSibling.style.maxHeight = "0px";
- });
- let thisMenu = x.nextElementSibling;
- thisMenu.style.maxHeight = thisMenu.scrollHeight + "px";
- };
- window.onclick = function(event) {
- let insideMenu = false;
- Array.from(document.querySelectorAll(".show")).forEach(menu => {
- insideMenu = insideMenu || menu.contains(event.target);
- });
- if (!insideMenu && !event.target.matches(".hover-menu")) {
- Array.from(document.querySelectorAll(".hover-menu")).forEach(
- hovermenu => {
- hovermenu.nextElementSibling.style.maxHeight = "0px";
- }
- );
- }
- };
-</script>
diff --git a/static/js/myFunctions.js b/static/js/myFunctions.js
index 196301e..8b376af 100644
--- a/static/js/myFunctions.js
+++ b/static/js/myFunctions.js
@@ -1,3 +1,21 @@
+window.onclick = function(event) {
+ let insideMenu = false;
+ Array.from(document.querySelectorAll(".show")).forEach(menu => {
+ insideMenu = insideMenu || menu.contains(event.target);
+ });
+ if (!insideMenu && !event.target.matches(".hover-menu")) {
+ Array.from(document.querySelectorAll(".hover-menu")).forEach(hovermenu => {
+ hovermenu.nextElementSibling.style.maxHeight = "0px";
+ });
+ }
+};
+let expandMenu = function(x) {
+ Array.from(document.querySelectorAll(".hover-menu")).forEach(hovermenu => {
+ hovermenu.nextElementSibling.style.maxHeight = "0px";
+ });
+ let thisMenu = x.nextElementSibling;
+ thisMenu.style.maxHeight = thisMenu.scrollHeight + "px";
+};
let scrollToTop = () => {
const c = document.documentElement.scrollTop || document.body.scrollTop;
if (c > 0) {