reorganize header menu
This commit is contained in:
+14
-25
@@ -1,11 +1,3 @@
|
||||
// Persistent left navigation rail. Renders the wiki folder/file tree, expanded
|
||||
// to the current page's ancestor chain, and lets the user navigate by clicking
|
||||
// folders (links) or open files locally via the companion (a.tree-file, wired
|
||||
// in companion.js). Shares the .tree-* CSS and the ?tree endpoint with
|
||||
// tree-picker.js but does not reuse its row builder — that one is modal-select
|
||||
// behavior, this one is navigation behavior. Hidden in edit mode (the server
|
||||
// omits the container).
|
||||
|
||||
(function () {
|
||||
// This script owns the .tree-scroll child of the aside, not the aside itself.
|
||||
var container = document.querySelector('aside.tree-sidebar .tree-scroll');
|
||||
@@ -188,24 +180,21 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Mobile: the tree FAB sits at the bottom of the stacked FAB group and
|
||||
// opens the tree's scroll container in the full-viewport Overlay
|
||||
// (overlay.js). The container always exists when not editing, so — per the
|
||||
// layout spec — the FAB always renders; the overlay auto-closes when a
|
||||
// folder/file link inside it navigates. Hidden on desktop by .fab CSS.
|
||||
function setupFab() {
|
||||
var fab = document.createElement('button');
|
||||
fab.type = 'button';
|
||||
fab.className = 'btn btn-fab fab fab-tree';
|
||||
fab.title = 'Folder tree';
|
||||
fab.setAttribute('aria-label', 'Folder tree');
|
||||
fab.innerHTML = '<svg viewBox="0 0 16 16" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="miter"><path d="M1 6h14v8H1zm0 0V4h5l1 2"/></svg>';
|
||||
fab.addEventListener('click', function () {
|
||||
if (typeof openOverlay === 'function') openOverlay(container);
|
||||
});
|
||||
document.body.appendChild(fab);
|
||||
function setupMenuItem() {
|
||||
var specials = document.querySelector('.actions-special');
|
||||
if (!specials) return;
|
||||
|
||||
var item = document.createElement("button");
|
||||
item.type = "button";
|
||||
item.className = "btn btn-block";
|
||||
item.title = "Folders";
|
||||
item.textContent = "FOLDERS";
|
||||
item.addEventListener("click", function () {
|
||||
if (typeof openOverlay === "function") openOverlay(aside);
|
||||
});
|
||||
specials.appendChild(item);
|
||||
}
|
||||
|
||||
render();
|
||||
setupFab();
|
||||
setupMenuItem();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user