static loadClick(e) {
      console.groupCollapsed(`${NAME}: load on click`);
      e.preventDefault();

      const ui = MainUILinks;
      const el = e.currentTarget;

      SpinnerUI.show();

      ui.reset();
      el.classList.add("loading");
      el.classList.remove("response-404", "response-500", "response-523");
      BODY.classList.add("ajax-loading");

      // hide parent mobile nav
      const navs = getParents(el, ".collapse");
      if (navs.length) {
        navs.forEach((nav) => {
          const collapseInst = Collapse.getInstance(nav);
          if (collapseInst) {
            collapseInst.hide();
          }
        });
      }

      // hide parent dropdown
      /*const dropdowns = getParents(el, '.dropdown-menu');
                                      if (dropdowns.length) {
                                        const DropdownInst = Dropdown.getInstance(dropdowns[0]);
                                        DropdownInst.hide();
                                      }*/

      if (!ui.GraphPage) {
        ui.GraphPage = ReactDOM.render(
          <Page />,
          document.getElementById("MainContent")
        );
      }

      const link = el.getAttribute("href") || el.getAttribute("data-href");

      ui.GraphPage.state.current = el;

      ui.GraphPage.load(link)
        .then((response) => {
          BODY.classList.remove("ajax-loading");
          el.classList.remove("loading");
          el.classList.add("active");

          D.loading_apollo_link = null;

          if (ui.GraphPage.state.Link) {
            window.history.pushState(
              {
                page: JSON.stringify(ui.GraphPage.state),
                link: el.getAttribute(`data-${ui.name}-id`),
              },
              ui.GraphPage.state.Title,
              ui.GraphPage.state.Link
            );

            ui.setActiveLinks(ui.GraphPage.state.Link);
          }

          SpinnerUI.hide();

          window.dispatchEvent(new Event(Events.AJAX));
          console.groupEnd(`${NAME}: load on click`);
        })
        .catch((e) => {
          console.error(`${NAME}: loading error`);
          console.log(e);

          /*BODY.classList.remove('ajax-loading');
                                                                                el.classList.remove('loading');*/
          el.classList.add("error", `response-${e.status}`);
          /*switch (e.status) {
                                                                                    case 500:
                                                                                        break;
                                                                                    case 404:
                                                                                        el.classList.add('not-found');
                                                                                        break;
                                                                                    case 523:
                                                                                        el.classList.add('unreachable');
                                                                                        break;
                                                                                }*/

          //SpinnerUI.hide();

          //window.dispatchEvent(new Event(Events.AJAX));
          console.groupEnd(`${NAME}: load on click`);

          console.log(`${NAME}: reloading page ${link}`);

          // fallback loading
          W.location.href = link;
        });
    }
// link specific event {this} = current event, not MainUILinks
link specific event {this} = current event, not MainUILinks
link specific event { this } = current event not MainUILinks
static loadClick(e) {
      console.groupCollapsed(`${NAME}: load on click`);
      e.preventDefault();
      const ui = MainUILinks;
      const el = e.currentTarget;
      SpinnerUI.show();
      ui.reset();
      el.classList.add("loading");
      el.classList.remove("response-404", "response-500", "response-523");
      BODY.classList.add("ajax-loading");
      const navs = getParents(el, ".collapse");
      if (navs.length) {
        navs.forEach((nav) => {
          const collapseInst = Collapse.getInstance(nav);
          if (collapseInst) {
            collapseInst.hide();
          }
        });
      }
      if (!ui.GraphPage) {
        ui.GraphPage = ReactDOM.render(
          <Page />,
          document.getElementById("MainContent")
        );
      }
      const link = el.getAttribute("href") || el.getAttribute("data-href");
      ui.GraphPage.state.current = el;
      ui.GraphPage.load(link)
        .then((response) => {
          BODY.classList.remove("ajax-loading");
          el.classList.remove("loading");
          el.classList.add("active");
          D.loading_apollo_link = null;
          if (ui.GraphPage.state.Link) {
            window.history.pushState(
              {
                page: JSON.stringify(ui.GraphPage.state),
                link: el.getAttribute(`data-${ui.name}-id`),
              },
              ui.GraphPage.state.Title,
              ui.GraphPage.state.Link
            );
            ui.setActiveLinks(ui.GraphPage.state.Link);
          }
          SpinnerUI.hide();
          window.dispatchEvent(new Event(Events.AJAX));
          console.groupEnd(`${NAME}: load on click`);
        })
        .catch((e) => {
          console.error(`${NAME}: loading error`);
          console.log(e);
          el.classList.add("error", `response-${e.status}`);
          console.groupEnd(`${NAME}: load on click`);
          console.log(`${NAME}: reloading page ${link}`);
          W.location.href = link;
        });
    }
static loadClick ( e ) { console . groupCollapsed ( ` ${ NAME } ` ) ; e . preventDefault ( ) ; const ui = MainUILinks ; const el = e . currentTarget ; SpinnerUI . show ( ) ; ui . reset ( ) ; el . classList . add ( "loading" ) ; el . classList . remove ( "response-404" , "response-500" , "response-523" ) ; BODY . classList . add ( "ajax-loading" ) ; const navs = getParents ( el , ".collapse" ) ; if ( navs . length ) { navs . forEach ( ( nav ) => { const collapseInst = Collapse . getInstance ( nav ) ; if ( collapseInst ) { collapseInst . hide ( ) ; } } ) ; } if ( ! ui . GraphPage ) { ui . GraphPage = ReactDOM . render ( < Page / > , document . getElementById ( "MainContent" ) ) ; } const link = el . getAttribute ( "href" ) || el . getAttribute ( "data-href" ) ; ui . GraphPage . state . current = el ; ui . GraphPage . load ( link ) . then ( ( response ) => { BODY . classList . remove ( "ajax-loading" ) ; el . classList . remove ( "loading" ) ; el . classList . add ( "active" ) ; D . loading_apollo_link = null ; if ( ui . GraphPage . state . Link ) { window . history . pushState ( { page : JSON . stringify ( ui . GraphPage . state ) , link : el . getAttribute ( ` ${ ui . name } ` ) , } , ui . GraphPage . state . Title , ui . GraphPage . state . Link ) ; ui . setActiveLinks ( ui . GraphPage . state . Link ) ; } SpinnerUI . hide ( ) ; window . dispatchEvent ( new Event ( Events . AJAX ) ) ; console . groupEnd ( ` ${ NAME } ` ) ; } ) . catch ( ( e ) => { console . error ( ` ${ NAME } ` ) ; console . log ( e ) ; el . classList . add ( "error" , ` ${ e . status } ` ) ; console . groupEnd ( ` ${ NAME } ` ) ; console . log ( ` ${ NAME } ${ link } ` ) ; W . location . href = link ; } ) ; }
link specific event {this} = current event, not MainUILinks
link specific event { this } = current event not MainUILinks
// hide parent mobile nav // hide parent dropdown /*const dropdowns = getParents(el, '.dropdown-menu');
                                      if (dropdowns.length) {
                                        const DropdownInst = Dropdown.getInstance(dropdowns[0]);
                                        DropdownInst.hide();
                                      }*/ /*BODY.classList.remove('ajax-loading');
                                                                                el.classList.remove('loading');*/ /*switch (e.status) {
                                                                                    case 500:
                                                                                        break;
                                                                                    case 404:
                                                                                        el.classList.add('not-found');
                                                                                        break;
                                                                                    case 523:
                                                                                        el.classList.add('unreachable');
                                                                                        break;
                                                                                }*/ //SpinnerUI.hide(); //window.dispatchEvent(new Event(Events.AJAX)); // fallback loading