Sha256: 076c4d11f2ebab8cde1ada8310f6bc4e3d2ce76ec562fe82b6a2a666b60b64a2

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

/*
// Custom JS | written by https://github.com/wdzajicek
// © 2020 Kankakee Community College
// =================================================== */
import start from './campusAlertsSheetsAPI.js';
import getCachedResponse from './getCachedResponse.js';
import checkForPrefersReducedMotion from './checkForPrefersReducedMotion.js';

function alerts(Collapse) {
  checkForPrefersReducedMotion();

  // Checks if our cached alert is already in sessionStorage
  if (!window.sessionStorage.getItem('Alert-Content')) {
    // If not, build the alert from a new Google API response
    gapi.load('client', () => {
      start(Collapse);
    });
  } else {
    // Otherwise, build the alert from our cached response
    getCachedResponse(Collapse);
  }
}

export default alerts;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kcc-gem-theme-original-1.0.2 assets/js/src/alerts.js