Skip to content

Commit

Permalink
chore: tidy up demo pages
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpatiiuk authored and jcfranco committed Sep 14, 2024
1 parent d1691b0 commit c98008e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
5 changes: 2 additions & 3 deletions packages/calcite-components/src/demos/_assets/head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
};

const loadHeader = async (): Promise<void> => {
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) {
Expand All @@ -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");
Expand Down
2 changes: 0 additions & 2 deletions packages/calcite-components/src/demos/input-time-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Input Time Picker</title>
<link rel="stylesheet" href="../build/calcite.css" />
<script type="module" src="../build/calcite.esm.js"></script>
<script src="./_assets/head.js"></script>
<style>
.demo-header {
Expand Down
2 changes: 0 additions & 2 deletions packages/calcite-components/src/demos/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Calcite Menu / Calcite Menu Item</title>
<link rel="stylesheet" href="../build/calcite.css" />
<script type="module" src="../build/calcite.esm.js"></script>
<script src="_assets/head.js"></script>

<script src="https://js.arcgis.com/next/"></script>
Expand Down
2 changes: 0 additions & 2 deletions packages/calcite-components/src/demos/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Calcite Nav / Calcite Nav Logo / Calcite Nav User</title>
<link rel="stylesheet" href="../build/calcite.css" />
<script type="module" src="../build/calcite.esm.js"></script>
<script src="_assets/head.js"></script>

<script src="https://js.arcgis.com/next/"></script>
Expand Down

0 comments on commit c98008e

Please sign in to comment.