Extract the top bar and account menu into shell_topbar.html and the member rail into shell_rail_member.html, backed by a single server.Shell value. Move session controls into the account menu, add the mirrored Operator panel/Member dashboard surface switch, and turn the rail into an offcanvas drawer below lg with shell.js closing it on navigation. Update docs, specs, and tests. Unify application shell across both surfaces Extract the top bar and member rail into shared partials and introduce server.Shell as the single data value for page chrome. Move session controls into an account menu, make the rail an offcanvas drawer below lg, and add the mirrored surface switch.
24 lines
1010 B
JavaScript
24 lines
1010 B
JavaScript
// Application shell (docs/design-system.md, "Application shell"): close the
|
|
// rail drawer when a rail entry is chosen.
|
|
//
|
|
// Below the lg breakpoint the rail (#app-rail) is a Bootstrap offcanvas. On
|
|
// the operator surface its entries navigate under hx-boost, which swaps the
|
|
// body but leaves Bootstrap's scroll lock on <body> behind unless the drawer
|
|
// is hidden first; on the member surface a full page load follows and this
|
|
// is a harmless no-op. Bootstrap's own data-bs-dismiss cannot go on the
|
|
// links: it cancels an anchor's navigation. This file is external because
|
|
// the content security policy forbids inline scripts.
|
|
(function () {
|
|
document.addEventListener('click', function (event) {
|
|
var link = event.target.closest('#app-rail a[href]');
|
|
if (!link || typeof bootstrap === 'undefined') {
|
|
return;
|
|
}
|
|
var rail = document.getElementById('app-rail');
|
|
var drawer = rail && bootstrap.Offcanvas.getInstance(rail);
|
|
if (drawer) {
|
|
drawer.hide();
|
|
}
|
|
});
|
|
})();
|