Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tidy up demo pages #10314

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading