feat: Begins a generic htmx form context and template, integrates user form, begins views for vendor and purchase orders.

This commit is contained in:
2025-01-08 14:02:50 -05:00
parent 3557227430
commit 2b6e92a5c6
18 changed files with 493 additions and 93 deletions

26
Public/js/main.js Normal file
View File

@@ -0,0 +1,26 @@
// Close dropdown if user clicks outside of it.
// Adapted from: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_js_dropdown
//
window.onClick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i=0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
// Show the drop-down menu, with the given id.
function showDropdownContent(id) {
document.getElementById(id).classList.toggle("show");
}
// Update the drop-down with the item that was clicked inside it's menu.
function updateDropDownSelection(id, contentId) {
let content = document.getElementById(contentId).innerHTML;
document.getElementById(id).innerHTML = content;
}