navbar: Add button to toggle left sidebar.

This commit is contained in:
Aman Agrawal
2024-04-22 08:32:21 +00:00
committed by Tim Abbott
parent c531631ecf
commit 96dac9ece9
6 changed files with 85 additions and 22 deletions

View File

@@ -591,6 +591,24 @@ export function initialize(): void {
},
});
tippy.delegate("body", {
target: ".header-main .column-left .left-sidebar-toggle-button",
delay: LONG_HOVER_DELAY,
placement: "bottom",
appendTo: () => document.body,
onShow(instance) {
let template = "show-left-sidebar-tooltip-template";
if ($("#left-sidebar-container").is(":visible")) {
template = "hide-left-sidebar-tooltip-template";
}
$(instance.reference).attr("data-tooltip-template-id", template);
instance.setContent(get_tooltip_content(instance.reference));
},
onHidden(instance) {
instance.destroy();
},
});
tippy.delegate("body", {
target: "#userlist-toggle",
delay: LONG_HOVER_DELAY,