Sha256: b55a3d1681e7b72ff7ea9c4f8003e2fb33030f9fd8535fe34181f6073692706e

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 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 ytEmbed from './ytEmbed.js';
//import test from './test.js';

document.addEventListener('DOMContentLoaded', function() {
  wrapPowerText();
  initSliders();
  walkText(document.body);
  footerDate();
  lazyLoad();
  addClassToOpenNavbar();
  if (document.getElementById('google_translate_element')) {
    import(/* webpackChunkName: 'translate' */ './translate').then(({default: watchForMenuClicks}) => {
      watchForMenuClicks();
    });
  }
  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();
      });
    })
  }

  // 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

5 entries across 5 versions & 1 rubygems

Version Path
kcc-gem-theme-2.2.1 assets/js/src/all.js
kcc-gem-theme-2.2.0 assets/js/src/all.js
kcc-gem-theme-2.1.3 assets/js/src/all.js
kcc-gem-theme-2.0.3 assets/js/src/all.js
kcc-gem-theme-2.0.2 assets/js/src/all.js