ad57d372 by Jeff Balicki

fixed js imports

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent ea12a50d
......@@ -4,8 +4,8 @@
* Licensed under GPL-3.0 (undefined)
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('._menu_mobile'), require('._search')) :
typeof define === 'function' && define.amd ? define(['exports', '._menu_mobile', '._search'], factory) :
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.understrap = {}));
})(this, (function (exports) { 'use strict';
......@@ -7434,6 +7434,87 @@
autoInitialize(LazyLoad, window.lazyLoadOptions);
}
var addstuff = '<div class="list-wrapper2 list-wrapper"><button type="button" class="back-one-level"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path d="M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z"/></svg><span>Back</span></button><div class="sub-menu-wrapper"></div></div><div class="list-wrapper3 list-wrapper"><button type="button" class="back-one-level"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path d="M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z"/></svg><span>Back</span></button><div class="sub-menu-wrapper"></div></div>';
const pageHeader = document.querySelector("#main-nav");
const toggleMenu = pageHeader.querySelector(".mega-toggle-block");
const menuWrapper = pageHeader.querySelector("#mega-menu-primary");
menuWrapper.innerHTML = menuWrapper.innerHTML + addstuff;
const level1Links = pageHeader.querySelectorAll("li.mega-menu-item-has-children > a.mega-menu-link");
const listWrapper2 = pageHeader.querySelector(".list-wrapper2");
const listWrapper3 = pageHeader.querySelector(".list-wrapper3");
const subMenuWrapper2 = listWrapper2.querySelector(".sub-menu-wrapper");
const subMenuWrapper3 = listWrapper3.querySelector(".sub-menu-wrapper");
const backOneLevelBtns = pageHeader.querySelectorAll(".back-one-level");
const isVisibleClass = "is-visible";
const isActiveClass = "is-active";
toggleMenu.addEventListener("click", function () {
menuWrapper.classList.toggle(isVisibleClass);
if (!this.classList.contains(isVisibleClass)) {
listWrapper2.classList.remove(isVisibleClass);
listWrapper3.classList.remove(isVisibleClass);
const menuLinks = menuWrapper.querySelectorAll("a");
for (const menuLink of menuLinks) {
menuLink.classList.remove(isActiveClass);
}
}
});
for (const level1Link of level1Links) {
level1Link.addEventListener("click", function (e) {
const siblingList = level1Link.nextElementSibling;
console.log('clicked level1Links');
if (siblingList) {
e.preventDefault();
this.classList.add(isActiveClass);
const cloneSiblingList = siblingList.cloneNode(true);
subMenuWrapper2.innerHTML = "";
subMenuWrapper2.append(cloneSiblingList);
listWrapper2.classList.add(isVisibleClass);
}
});
}
listWrapper2.addEventListener("click", function (e) {
const target = e.target;
const parent = target.closest("a");
if (target.tagName.toLowerCase() === "a" && target.nextElementSibling) {
const siblingList = target.nextElementSibling;
e.preventDefault();
target.classList.add(isActiveClass);
const cloneSiblingList = siblingList.cloneNode(true);
subMenuWrapper3.innerHTML = "";
subMenuWrapper3.append(cloneSiblingList);
listWrapper3.classList.add(isVisibleClass);
} else if (parent.tagName.toLowerCase() === "a" && parent.nextElementSibling) {
const siblingList = parent.nextElementSibling;
e.preventDefault();
parent.classList.add(isActiveClass);
const cloneSiblingList = siblingList.cloneNode(true);
subMenuWrapper3.innerHTML = "";
subMenuWrapper3.append(cloneSiblingList);
listWrapper3.classList.add(isVisibleClass);
}
});
for (const backOneLevelBtn of backOneLevelBtns) {
backOneLevelBtn.addEventListener("click", function () {
const parent = this.closest(".list-wrapper");
parent.classList.remove(isVisibleClass);
// parent.previousElementSibling
// .querySelector(".is-active")
// .classList.remove(isActiveClass);
});
}
// Search Filter
jQuery(document).ready(function ($) {
$(".searchandfilter ul li:contains('hidden')").hide();
$('<li class="sf-field-reset"><input type="submit" class="search-filter-reset-custom" value="CLEAR ALL" "></li>').appendTo(jQuery('#advance-search-modal .searchandfilter ul:first-child '));
$(document).on("click", ".search-filter-reset-custom", function (e) {
e.preventDefault();
$(this).closest('.searchandfilter')[0].reset();
return false;
});
});
// Add your custom JS here.
new LazyLoad();
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
// Add your custom JS here.
import "._menu_mobile";
import "._search";
import LazyLoad from "vanilla-lazyload";
import "./_menu_mobile";
import "./_search";
var myLazyLoad = new LazyLoad();
......