Sha256: d0a4e8be16200c0924400dc956c9b179bb29fd9f848304b36c9f7e307b6258e3

Contents?: true

Size: 1.96 KB

Versions: 2

Compression:

Stored size: 1.96 KB

Contents

import footerDate from './footerDate.js';
import lazyLoad from './lazyLoad.js';
import walkText from './walkText.js';
import initSliders from './sliders.js';
import wrapPowerText from './wrapPowerText.js';
import addClassToOpenNavbar from './addClassToOpenNavbar.js';
import '../../scss/kcc-theme.scss';

document.addEventListener('DOMContentLoaded', function() {
  wrapPowerText();
  initSliders();
  walkText(document.body);
  footerDate();
  lazyLoad();
  addClassToOpenNavbar();
  if (window.localStorage.getItem('darkModeSetting') == 'true' || window.location.pathname == '/settings/') {
    import(/* webpackChunkName: 'darkMode' */ './darkMode').then(({ default: darkMode }) => {
      return darkMode;
    }).then(darkMode => {
      import(/* webpackChunkName: 'darkModeStyling' */ '../../scss/darkMode.scss').then(() => {
        darkMode();
      });
    })
  }
  if (window.location.pathname == "/search/") {
    import(/* webpackChunkName: 'searchPageOverrides' */ '../../scss/searchPageOverrides.scss').then(() => {
      console.info('Search page overrides styling loaded');
    }).catch( err => console.error(`Error loading searchPageOverrides.scss \n${err}`, err) );
  }
  if (document.getElementById('google_translate_element')) {
    import(/* webpackChunkName: 'translateScript' */ './translateScript').then(({default: watchForMenuClicks}) => {
      watchForMenuClicks();
    });
  }

  // polyfill for Element.closest() b/c IE can't handle an anchor.match() when the anchor has another element inside it (Like spans used for BS4 menu toggler)
  if (!Element.prototype.matches) {
    Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  }

  if (!Element.prototype.closest) {
    Element.prototype.closest = function(s) {
      var el = this;

      do {
        if (el.matches(s)) return el;
        el = el.parentElement || el.parentNode;
      } while (el !== null && el.nodeType === 1);
      return null;
    };
  }
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kcc-gem-theme-2.4.1 assets/js/src/all.js
kcc-gem-theme-2.4.0 assets/js/src/all.js