Sha256: a6903375b8d3855b7287bf3e8952439b253bb9ad39b372c02d33340117f085b3

Contents?: true

Size: 838 Bytes

Versions: 3

Compression:

Stored size: 838 Bytes

Contents

import '../../scss/main.scss';
// import test from './test';

function loadModule(module) {
  return import(`${module}`).then(({default: module}) => module())
}

window.addEventListener('load', () => {

  Promise.resolve()
    .then(() => {
      if (!document.querySelector('img[data-src]'))
        return;
      
      return loadModule('./lazyLoad');
    }).then(() => loadModule('./footerDate'))
    .then(() => {
      if (!document.querySelector('a[href="#page-top"]'))
        return;
      
      return loadModule('./landingPage');
    }).then(() => {
      if (!document.getElementById('SearchTermForm'))
        return;
      
      return import('./watchForWebsiteSearch').then(({ default: init }) => init());
    }).catch(err => {
      console.error(`Error loading landing-page JS modules: ${err.message}`, err);
    })
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
landing-page-gem-0.7.1 assets/js/src/main.js
landing-page-gem-0.7.0 assets/js/src/main.js
landing-page-gem-0.6.0 assets/js/src/main.js