mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-11-02 14:12:42 +08:00
fix(mobile): clicking sidebar backdrop to hide it
This commit is contained in:
parent
fb5391a243
commit
a025645972
@ -42,10 +42,6 @@ export default class SidebarContainer extends FlexContainer {
|
||||
doRender() {
|
||||
super.doRender();
|
||||
|
||||
this.$widget.on("click", () => {
|
||||
this.triggerCommand('setActiveScreen', { screen: "detail" });
|
||||
});
|
||||
|
||||
document.addEventListener("touchstart", (e) => this.#onDragStart(e));
|
||||
document.addEventListener("touchmove", (e) => this.#onDragMove(e), { passive: false });
|
||||
document.addEventListener("touchend", (e) => this.#onDragEnd(e));
|
||||
@ -133,6 +129,9 @@ export default class SidebarContainer extends FlexContainer {
|
||||
|
||||
const sidebarEl = document.getElementById("mobile-sidebar-wrapper");
|
||||
const backdropEl = document.getElementById("mobile-sidebar-container");
|
||||
backdropEl?.addEventListener("click", () => {
|
||||
this.triggerCommand('setActiveScreen', { screen: "detail" });
|
||||
});
|
||||
|
||||
if (!sidebarEl || !backdropEl) {
|
||||
throw new Error("Unable to find the sidebar or backdrop.");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user