From c98008e05909a41a263d61da37acaee55ad40597 Mon Sep 17 00:00:00 2001 From: Max Patiiuk Date: Fri, 13 Sep 2024 22:42:59 -0700 Subject: [PATCH] chore: tidy up demo pages --- packages/calcite-components/src/demos/_assets/head.ts | 5 ++--- packages/calcite-components/src/demos/input-time-picker.html | 2 -- packages/calcite-components/src/demos/menu.html | 2 -- packages/calcite-components/src/demos/navigation.html | 2 -- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/calcite-components/src/demos/_assets/head.ts b/packages/calcite-components/src/demos/_assets/head.ts index b82226531b6..3322a2aafb2 100644 --- a/packages/calcite-components/src/demos/_assets/head.ts +++ b/packages/calcite-components/src/demos/_assets/head.ts @@ -31,8 +31,7 @@ }; const loadHeader = async (): Promise => { - const root = window.location.pathname.split(DEMO_ROOT).shift(); - const response = await window.fetch(`${root}${ASSETS_PATH}/demo-template.html`); + const response = await window.fetch(`${ROOT}${ASSETS_PATH}/demo-template.html`); const text = await response.text(); const template = parseTemplate(text); if (template) { @@ -45,7 +44,7 @@ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", loadHeader) : loadHeader(); } - const ROOT = window.location.pathname.split(DEMO_ROOT).shift(); + const ROOT = window.location.pathname.split(DEMO_ROOT)[0]; function loadCss(url: string): void { const link = document.createElement("link"); diff --git a/packages/calcite-components/src/demos/input-time-picker.html b/packages/calcite-components/src/demos/input-time-picker.html index 50918a41ffa..599dec949e3 100644 --- a/packages/calcite-components/src/demos/input-time-picker.html +++ b/packages/calcite-components/src/demos/input-time-picker.html @@ -5,8 +5,6 @@ Input Time Picker - -