mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-28 07:51:31 +08:00
Avoid triggering tab switch on long press.
This commit is contained in:
parent
7ec73698ab
commit
91231874e3
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" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
|
on(event: "pointerDown" | "pointerUp" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
|
||||||
dragEnd();
|
dragEnd();
|
||||||
isDragging: boolean;
|
isDragging: boolean;
|
||||||
positionDrag: () => void;
|
positionDrag: () => void;
|
||||||
|
@ -671,8 +671,14 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
|
|
||||||
this.draggabillies.push(draggabilly);
|
this.draggabillies.push(draggabilly);
|
||||||
|
|
||||||
|
let pointerDownTime: number = 0;
|
||||||
draggabilly.on("pointerDown", () => {
|
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