mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 19:52:28 +08:00
Fix trackpad not switching tabs.
This commit is contained in:
parent
897fde7332
commit
d1c2672f99
2
src/public/app/types-lib.d.ts
vendored
2
src/public/app/types-lib.d.ts
vendored
@ -13,7 +13,7 @@ declare module "draggabilly" {
|
|||||||
containment: HTMLElement
|
containment: HTMLElement
|
||||||
});
|
});
|
||||||
element: HTMLElement;
|
element: HTMLElement;
|
||||||
on(event: "pointerDown" | "pointerUp" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
|
on(event: "staticClick" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
|
||||||
dragEnd();
|
dragEnd();
|
||||||
isDragging: boolean;
|
isDragging: boolean;
|
||||||
positionDrag: () => void;
|
positionDrag: () => void;
|
||||||
|
@ -676,14 +676,8 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
|
|
||||||
this.draggabillies.push(draggabilly);
|
this.draggabillies.push(draggabilly);
|
||||||
|
|
||||||
let pointerDownTime: number = 0;
|
draggabilly.on("staticClick", () => {
|
||||||
draggabilly.on("pointerDown", () => {
|
|
||||||
pointerDownTime = Date.now();
|
|
||||||
});
|
|
||||||
draggabilly.on("pointerUp", () => {
|
|
||||||
if (Date.now() - pointerDownTime < 200) {
|
|
||||||
appContext.tabManager.activateNoteContext(tabEl.getAttribute("data-ntx-id"));
|
appContext.tabManager.activateNoteContext(tabEl.getAttribute("data-ntx-id"));
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
draggabilly.on("dragStart", () => {
|
draggabilly.on("dragStart", () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user