CSS: - Remove duplicate li::before block in app-search.css - Fix typo: search-reuslt → search-result in app-search.css - Remove commented-out CSS rules in app-flash.css - Add descriptive header comment to all 27 CSS component files JS: - Complete WAI-ARIA Tabs pattern: generate IDs, add aria-controls on tab buttons and aria-labelledby on tab panels (app-tabs.js) - Add JSDoc header comments to ~33 JS files (core + components) - Add explanatory block comment to app-boot.js (why classic IIFE) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
934 B
JavaScript
40 lines
934 B
JavaScript
/**
|
|
* Initializes detail page open-state persistence and action policy.
|
|
*/
|
|
import { initPersistedDetailsGroup } from '../core/app-details-open-state.js';
|
|
|
|
const controllerRegistry = new WeakMap();
|
|
|
|
const initDetailsGroup = (group) => {
|
|
if (!group || group.dataset.detailsStorageBound === '1') {
|
|
return;
|
|
}
|
|
|
|
const storageKey = (group.dataset.detailsStorage || '').trim();
|
|
if (!storageKey) {
|
|
return;
|
|
}
|
|
|
|
const controller = initPersistedDetailsGroup({
|
|
root: group,
|
|
storageKey,
|
|
});
|
|
if (!controller) {
|
|
return;
|
|
}
|
|
|
|
controllerRegistry.set(group, controller);
|
|
group.dataset.detailsStorageBound = '1';
|
|
};
|
|
|
|
const initDetailsState = () => {
|
|
const groups = Array.from(document.querySelectorAll('[data-details-storage]'));
|
|
groups.forEach(initDetailsGroup);
|
|
};
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', initDetailsState);
|
|
} else {
|
|
initDetailsState();
|
|
}
|