Clickable home page stat cards; clean up nav; add buttons on list pages; move export/import to home
This commit is contained in:
@@ -61,6 +61,27 @@ function metaSelectChanged(sel, inputId) {
|
||||
if (e.key === 'Escape' && modal.classList.contains('open')) closeModal();
|
||||
});
|
||||
|
||||
// Apply URL params as initial filter state on battery_list and device_list
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
var statusParam = params.get('status');
|
||||
if (statusParam !== null) {
|
||||
var statusSel = document.getElementById('filter-status');
|
||||
if (statusSel && typeof applyFilters === 'function') {
|
||||
statusSel.value = statusParam;
|
||||
applyFilters();
|
||||
}
|
||||
}
|
||||
var fillParam = params.get('fill');
|
||||
if (fillParam !== null) {
|
||||
var fillSel = document.getElementById('filter-fill');
|
||||
if (fillSel && typeof applyDeviceFilters === 'function') {
|
||||
fillSel.value = fillParam;
|
||||
applyDeviceFilters();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Global handler: forms with data-confirm attribute
|
||||
document.addEventListener('submit', function(e) {
|
||||
var form = e.target;
|
||||
|
||||
Reference in New Issue
Block a user