@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
27 lines (26 loc) • 834 B
JavaScript
/*!
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
* v1.5.0-next.4
*/
import { initModeChangeEvent } from "./mode";
/**
* This file is imported in Stencil's `globalScript` config option.
*
* @see {@link https://stenciljs.com/docs/config#globalscript}
*/
export default function () {
const isBrowser = typeof window !== "undefined" &&
typeof location !== "undefined" &&
typeof document !== "undefined" &&
window.location === location &&
window.document === document;
if (isBrowser) {
if (document.readyState === "interactive") {
initModeChangeEvent();
}
else {
document.addEventListener("DOMContentLoaded", () => initModeChangeEvent(), { once: true });
}
}
}