Add sidebar toggle button to breadcrumb with open/close functionality
Move sidebar toggle from sidebar panel to breadcrumb navigation, positioned left of the HOME icon. Uses distinct icons for open (sidebar-inset) and closed (sidebar) states. Sidebar state persists via sessionStorage. Remove old non-functional toggle buttons from layout and HTMLBlock plugin.
This commit is contained in:
@@ -65,40 +65,6 @@ class HTMLBlock
|
||||
}
|
||||
}
|
||||
|
||||
$content .= '
|
||||
<hr>
|
||||
<h6>Actions</h6>
|
||||
<div class="d-grid gap-2">
|
||||
<button class="btn btn-sm btn-outline-primary" onclick="refreshContent()">
|
||||
<i class="bi bi-arrow-clockwise"></i> Ververs Content
|
||||
</button>
|
||||
<button class="btn btn-sm btn-outline-secondary" onclick="toggleSidebar()">
|
||||
<i class="bi bi-layout-sidebar"></i> Toggle Sidebar
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function refreshContent() {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
function toggleSidebar() {
|
||||
const sidebar = document.getElementById("site-sidebar");
|
||||
const content = document.getElementById("site-content");
|
||||
if (sidebar.style.display === "none") {
|
||||
sidebar.style.display = "";
|
||||
content.classList.remove("col-12");
|
||||
content.classList.add("col-lg-9", "col-md-8");
|
||||
} else {
|
||||
sidebar.style.display = "none";
|
||||
content.classList.remove("col-lg-9", "col-md-8");
|
||||
content.classList.add("col-12");
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user