0

I am trying to fix this console error "Uncaught TypeError: Cannot read property 'querySelector' of null at new globalNavPopup".

Function:

function globalNavPopup(e) {
  var t = this,
  n = Strut.touch.isSupported ? "touchend" : "click";
  this.activeClass = "globalPopupActive", this.root = document.querySelector(e), this.link = this.root.querySelector(".rootLink"), this.popup = this.root.querySelector(".popup"), this.closeButton = this.root.querySelector(".popupCloseButton"), this.link.addEventListener(n, function (e) {
    e.stopPropagation(), t.togglePopup();
  }), this.popup.addEventListener(n, function (e) {
    e.stopPropagation();
  }), this.closeButton && this.closeButton.addEventListener(n, function (e) {
    t.closeAllPopups();
  }), document.body.addEventListener(n, function (e) {
    Strut.touch.isDragging || t.closeAllPopups();
  }, !1);
}

Here is the codepen

https://codepen.io/JakeHenshall/pen/ZBvLgG

There is a similar thread, but my low rep prevent me from commenting.

Can someone help me with this ?

Thanks

Fred
  • 1

0 Answers0