Capstone/ui/templates/script.templ

28 lines
794 B
Plaintext
Raw Normal View History

2023-10-28 10:45:47 -04:00
package templates
2023-10-28 11:15:42 -04:00
templ toggleNavBar() {
<script>
2023-10-28 10:45:47 -04:00
function toggleNavbar(collapseID) {
document.getElementById(collapseID).classList.toggle("hidden");
document.getElementById(collapseID).classList.toggle("block");
}
2023-10-28 11:15:42 -04:00
</script>
2023-10-28 10:45:47 -04:00
}
2023-11-02 21:06:35 -04:00
templ toggleDropdown() {
<script src="https://unpkg.com/@popperjs/core@2.9.1/dist/umd/popper.min.js" charset="utf-8"></script>
2023-11-02 21:06:35 -04:00
<script>
function openDropdown(event,dropdownID){
let element = event.target;
while(element.nodeName !== "BUTTON"){
element = element.parentNode;
}
var popper = Popper.createPopper(element, document.getElementById(dropdownID), {
placement: 'bottom-start'
});
document.getElementById(dropdownID).classList.toggle("hidden");
document.getElementById(dropdownID).classList.toggle("block");
}
</script>
2023-11-02 21:06:35 -04:00
}