fixed js imports
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
5 changed files
with
87 additions
and
5 deletions
| ... | @@ -4,8 +4,8 @@ | ... | @@ -4,8 +4,8 @@ |
| 4 | * Licensed under GPL-3.0 (undefined) | 4 | * Licensed under GPL-3.0 (undefined) |
| 5 | */ | 5 | */ |
| 6 | (function (global, factory) { | 6 | (function (global, factory) { |
| 7 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('._menu_mobile'), require('._search')) : | 7 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : |
| 8 | typeof define === 'function' && define.amd ? define(['exports', '._menu_mobile', '._search'], factory) : | 8 | typeof define === 'function' && define.amd ? define(['exports'], factory) : |
| 9 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.understrap = {})); | 9 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.understrap = {})); |
| 10 | })(this, (function (exports) { 'use strict'; | 10 | })(this, (function (exports) { 'use strict'; |
| 11 | 11 | ||
| ... | @@ -7434,6 +7434,87 @@ | ... | @@ -7434,6 +7434,87 @@ |
| 7434 | autoInitialize(LazyLoad, window.lazyLoadOptions); | 7434 | autoInitialize(LazyLoad, window.lazyLoadOptions); |
| 7435 | } | 7435 | } |
| 7436 | 7436 | ||
| 7437 | 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>'; | ||
| 7438 | const pageHeader = document.querySelector("#main-nav"); | ||
| 7439 | const toggleMenu = pageHeader.querySelector(".mega-toggle-block"); | ||
| 7440 | const menuWrapper = pageHeader.querySelector("#mega-menu-primary"); | ||
| 7441 | menuWrapper.innerHTML = menuWrapper.innerHTML + addstuff; | ||
| 7442 | const level1Links = pageHeader.querySelectorAll("li.mega-menu-item-has-children > a.mega-menu-link"); | ||
| 7443 | const listWrapper2 = pageHeader.querySelector(".list-wrapper2"); | ||
| 7444 | const listWrapper3 = pageHeader.querySelector(".list-wrapper3"); | ||
| 7445 | const subMenuWrapper2 = listWrapper2.querySelector(".sub-menu-wrapper"); | ||
| 7446 | const subMenuWrapper3 = listWrapper3.querySelector(".sub-menu-wrapper"); | ||
| 7447 | const backOneLevelBtns = pageHeader.querySelectorAll(".back-one-level"); | ||
| 7448 | const isVisibleClass = "is-visible"; | ||
| 7449 | const isActiveClass = "is-active"; | ||
| 7450 | toggleMenu.addEventListener("click", function () { | ||
| 7451 | menuWrapper.classList.toggle(isVisibleClass); | ||
| 7452 | if (!this.classList.contains(isVisibleClass)) { | ||
| 7453 | listWrapper2.classList.remove(isVisibleClass); | ||
| 7454 | listWrapper3.classList.remove(isVisibleClass); | ||
| 7455 | const menuLinks = menuWrapper.querySelectorAll("a"); | ||
| 7456 | for (const menuLink of menuLinks) { | ||
| 7457 | menuLink.classList.remove(isActiveClass); | ||
| 7458 | } | ||
| 7459 | } | ||
| 7460 | }); | ||
| 7461 | for (const level1Link of level1Links) { | ||
| 7462 | level1Link.addEventListener("click", function (e) { | ||
| 7463 | const siblingList = level1Link.nextElementSibling; | ||
| 7464 | console.log('clicked level1Links'); | ||
| 7465 | if (siblingList) { | ||
| 7466 | e.preventDefault(); | ||
| 7467 | this.classList.add(isActiveClass); | ||
| 7468 | const cloneSiblingList = siblingList.cloneNode(true); | ||
| 7469 | subMenuWrapper2.innerHTML = ""; | ||
| 7470 | subMenuWrapper2.append(cloneSiblingList); | ||
| 7471 | listWrapper2.classList.add(isVisibleClass); | ||
| 7472 | } | ||
| 7473 | }); | ||
| 7474 | } | ||
| 7475 | listWrapper2.addEventListener("click", function (e) { | ||
| 7476 | const target = e.target; | ||
| 7477 | const parent = target.closest("a"); | ||
| 7478 | if (target.tagName.toLowerCase() === "a" && target.nextElementSibling) { | ||
| 7479 | const siblingList = target.nextElementSibling; | ||
| 7480 | e.preventDefault(); | ||
| 7481 | target.classList.add(isActiveClass); | ||
| 7482 | const cloneSiblingList = siblingList.cloneNode(true); | ||
| 7483 | subMenuWrapper3.innerHTML = ""; | ||
| 7484 | subMenuWrapper3.append(cloneSiblingList); | ||
| 7485 | listWrapper3.classList.add(isVisibleClass); | ||
| 7486 | } else if (parent.tagName.toLowerCase() === "a" && parent.nextElementSibling) { | ||
| 7487 | const siblingList = parent.nextElementSibling; | ||
| 7488 | e.preventDefault(); | ||
| 7489 | parent.classList.add(isActiveClass); | ||
| 7490 | const cloneSiblingList = siblingList.cloneNode(true); | ||
| 7491 | subMenuWrapper3.innerHTML = ""; | ||
| 7492 | subMenuWrapper3.append(cloneSiblingList); | ||
| 7493 | listWrapper3.classList.add(isVisibleClass); | ||
| 7494 | } | ||
| 7495 | }); | ||
| 7496 | for (const backOneLevelBtn of backOneLevelBtns) { | ||
| 7497 | backOneLevelBtn.addEventListener("click", function () { | ||
| 7498 | const parent = this.closest(".list-wrapper"); | ||
| 7499 | parent.classList.remove(isVisibleClass); | ||
| 7500 | // parent.previousElementSibling | ||
| 7501 | // .querySelector(".is-active") | ||
| 7502 | // .classList.remove(isActiveClass); | ||
| 7503 | }); | ||
| 7504 | } | ||
| 7505 | |||
| 7506 | // Search Filter | ||
| 7507 | |||
| 7508 | jQuery(document).ready(function ($) { | ||
| 7509 | $(".searchandfilter ul li:contains('hidden')").hide(); | ||
| 7510 | $('<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 ')); | ||
| 7511 | $(document).on("click", ".search-filter-reset-custom", function (e) { | ||
| 7512 | e.preventDefault(); | ||
| 7513 | $(this).closest('.searchandfilter')[0].reset(); | ||
| 7514 | return false; | ||
| 7515 | }); | ||
| 7516 | }); | ||
| 7517 | |||
| 7437 | // Add your custom JS here. | 7518 | // Add your custom JS here. |
| 7438 | new LazyLoad(); | 7519 | new LazyLoad(); |
| 7439 | 7520 | ... | ... |
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.
| 1 | // Add your custom JS here. | 1 | // Add your custom JS here. |
| 2 | |||
| 3 | import "._menu_mobile"; | ||
| 4 | import "._search"; | ||
| 5 | import LazyLoad from "vanilla-lazyload"; | 2 | import LazyLoad from "vanilla-lazyload"; |
| 6 | 3 | ||
| 4 | import "./_menu_mobile"; | ||
| 5 | import "./_search"; | ||
| 6 | |||
| 7 | |||
| 7 | var myLazyLoad = new LazyLoad(); | 8 | var myLazyLoad = new LazyLoad(); |
| 8 | 9 | ||
| 9 | 10 | ... | ... |
-
Please register or sign in to post a comment