initial commit
This commit is contained in:
22
layouts/partials/common/scripts.html
Normal file
22
layouts/partials/common/scripts.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<script src="/pagefind/pagefind-ui.js"></script>
|
||||
<script>
|
||||
window.addEventListener("DOMContentLoaded", (event) => {
|
||||
new PagefindUI({ element: "#search", showSubResults: true });
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const dialog = document.querySelector("dialog");
|
||||
const showButton = document.getElementById("createStoryBtn");
|
||||
const closeButton = document.getElementById("closeStoryModal");
|
||||
|
||||
// "Show the dialog" button opens the dialog modally
|
||||
showButton.addEventListener("click", () => {
|
||||
dialog.showModal();
|
||||
});
|
||||
|
||||
// "Close" button closes the dialog
|
||||
closeButton.addEventListener("click", () => {
|
||||
dialog.close();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user