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:
Diffstat (limited to 'static/js/myFunctions.js')
-rw-r--r--static/js/myFunctions.js27
1 files changed, 11 insertions, 16 deletions
diff --git a/static/js/myFunctions.js b/static/js/myFunctions.js
index 82d4804..4e9c671 100644
--- a/static/js/myFunctions.js
+++ b/static/js/myFunctions.js
@@ -1,32 +1,27 @@
-window.onclick = function(event) {
+window.onclick = function (event) {
checkClick(event);
};
-window.ontouchstart = function(event) {
+window.ontouchstart = function (event) {
checkClick(event);
};
-checkClick = function(event) {
+checkClick = function (event) {
let insideMenu = false;
- Array.from(document.querySelectorAll(".show")).forEach(menu => {
+ 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";
- });
+ 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 => {
+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) {
- window.requestAnimationFrame(scrollToTop);
- window.scrollTo(0, c - c / 8);
- }
-}; \ No newline at end of file