MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / initializeListButtons

Function initializeListButtons

renderer.js:16562–16578  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16560
16561 // Add click handler
16562 header.addEventListener('click', async () => {
16563 const sortSelect = document.getElementById('sort-select');
16564 if (!sortSelect) return;
16565
16566 const currentSort = sortSelect.value;
16567 let newSort;
16568
16569 // Determine new sort based on current state
16570 if (currentSort === `${sortKey}-asc`) {
16571 newSort = `${sortKey}-desc`;
16572 } else if (currentSort === `${sortKey}-desc`) {
16573 newSort = `${sortKey}-asc`;
16574 } else {
16575 // Default to ascending when clicking a new column
16576 newSort = `${sortKey}-asc`;
16577 }
16578
16579 // Update sort select - check if option exists first
16580 if (sortSelect.querySelector(`option[value="${newSort}"]`)) {
16581 sortSelect.value = newSort;

Callers 2

renderer.jsFile · 0.85
showMultiEditPanelFunction · 0.85

Calls 1

showSearchableListDialogFunction · 0.85

Tested by

no test coverage detected