fix(components): replace initialization of components to prevent overrides
This commit is contained in:
parent
37a1551699
commit
8cbd097389
4 changed files with 6 additions and 6 deletions
|
|
@ -38,7 +38,7 @@ function toggleAccordion(item: HTMLElement, state: AccordionState) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
qsa(".msp-accordion-item").forEach((item) => {
|
qsa(".msp-accordion-item").forEach((item) => {
|
||||||
qs(".msp-accordion-header", item)?.addEventListener("click", (e) => {
|
qs(".msp-accordion-header", item)?.addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
@ -50,4 +50,4 @@ window.onload = () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { qs, qsa } from "../utils";
|
import { qs, qsa } from "../utils";
|
||||||
|
|
||||||
window.onload = () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
qsa(".msp-offcanvas-toggle").forEach((item) => {
|
qsa(".msp-offcanvas-toggle").forEach((item) => {
|
||||||
item.addEventListener("click", () => {
|
item.addEventListener("click", () => {
|
||||||
const target = item.dataset.mspTarget;
|
const target = item.dataset.mspTarget;
|
||||||
|
|
@ -18,4 +18,4 @@ window.onload = () => {
|
||||||
targetElement.classList.toggle("show");
|
targetElement.classList.toggle("show");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
<body transition:animate="fade">
|
<body transition:animate="fade">
|
||||||
{% include "partials/header.html" %}
|
{% include "partials/header.html" %}
|
||||||
<main>
|
<main>
|
||||||
<nav class="msp-d-flex msp-justify-content-end">
|
<nav class="msp-d-sm-none msp-d-flex msp-justify-content-end">
|
||||||
<button class="msp-offcanvas-toggle" data-msp-target="#main-offcanvas">Toggle</button>
|
<button class="msp-offcanvas-toggle" data-msp-target="#main-offcanvas">Toggle</button>
|
||||||
</nav>
|
</nav>
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
{% for item in get_taxonomy(kind="section") | get(key="items") %}
|
{% for item in get_taxonomy(kind="section") | get(key="items") %}
|
||||||
<li class="msp-accordion-item">
|
<li class="msp-accordion-item">
|
||||||
<a class="msp-accordion-header" href="{{ get_url(path="@/" ~ item.slug ~ "/_index.md") }}">{{ item.name |
|
<a class="msp-accordion-header" href="#">{{ item.name |
|
||||||
title
|
title
|
||||||
}}</a>
|
}}</a>
|
||||||
<div class="msp-accordion-collapse">
|
<div class="msp-accordion-collapse">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue