mirror of
https://github.com/gtbu/Typesetter-5.3-p8.git
synced 2024-11-21 13:59:11 +01:00
embedded init.js
This commit is contained in:
parent
20ee404411
commit
1984cc52b7
2 changed files with 1 additions and 59 deletions
|
@ -2,62 +2,3 @@
|
|||
function externalLinks() { for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) { var b = c[a];
|
||||
b.getAttribute("href") && b.hostname !== location.hostname && (b.rel = "nofollow noopener") } } ; externalLinks();
|
||||
|
||||
|
||||
// menu -classes
|
||||
//$( "div.gpMenu ul.dropdown-menu li a").addClass("dropdown-item");
|
||||
//$( "div.gpMenu ul.navbar-nav li.nav-item a").addClass("nav-link");
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("ul.navbar-nav > li > ul.dropdown-menu > li > ul.dropdown-menu").addClass("submenu");
|
||||
});
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var dropdownMenus = document.querySelectorAll("ul.navbar-nav > li > ul.dropdown-menu > li > ul.dropdown-menu");
|
||||
for (var i = 0; i < dropdownMenus.length; i++) {
|
||||
dropdownMenus[i].classList.add("submenu");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Replace div.gpMenu ul.dropdown-menu li a with dropdown-item class
|
||||
var dropdownItems = document.querySelectorAll("div.gpMenu ul.dropdown-menu li a");
|
||||
for (var i = 0; i < dropdownItems.length; i++) {
|
||||
dropdownItems[i].classList.add("dropdown-item");
|
||||
}
|
||||
|
||||
// Replace div.gpMenu ul.navbar-nav li.nav-item a with nav-link class
|
||||
var navLinks = document.querySelectorAll("div.gpMenu ul.navbar-nav li.nav-item a");
|
||||
for (var i = 0; i < navLinks.length; i++) {
|
||||
navLinks[i].classList.add("nav-link");
|
||||
}
|
||||
|
||||
|
||||
// JavaScript/jQuery code to handle dropdowns
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var dropdownToggle = document.querySelector(".navbar .dropdown-toggle");
|
||||
if (dropdownToggle) {
|
||||
dropdownToggle.addEventListener("click", function(e) {
|
||||
e.preventDefault();
|
||||
var dropdownMenu = dropdownToggle.nextElementSibling;
|
||||
if (dropdownMenu.style.display === "block") {
|
||||
dropdownMenu.style.display = "none";
|
||||
} else {
|
||||
dropdownMenu.style.display = "block";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// (c) 2020-2022 Written by Simon Köhler in Panama
|
||||
// github.com/koehlersimon
|
||||
// simon-koehler.com
|
||||
document.addEventListener('click',function(e){
|
||||
// Hamburger menu
|
||||
if(e.target.classList.contains('hamburger-toggle')){
|
||||
e.target.children[0].classList.toggle('active');
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -21,5 +21,6 @@ $themeDir = dirname($page->theme_path);
|
|||
//$page->head_js[] = $themeDir.'/assets/js/bootnavbar.js';
|
||||
|
||||
$page->head_js[] = $themeDir.'/assets/js/script.js';
|
||||
$page->head_js[] = $themeDir.'/assets/js/init.js';
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue