mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-27 23:41: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
|
||||
});
|
||||
element: HTMLElement;
|
||||
on(event: "pointerDown" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
|
||||
on(event: "pointerDown" | "pointerUp" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
|
||||
dragEnd();
|
||||
isDragging: boolean;
|
||||
positionDrag: () => void;
|
||||
|
@ -391,7 +391,7 @@ export default class TabRowWidget extends BasicWidget {
|
||||
this.$scrollButtonRight[0].addEventListener('click', () => this.scrollTabContainer(200));
|
||||
|
||||
this.$tabScrollingContainer[0].addEventListener('wheel', (event) => {
|
||||
const targetScrollLeft = event.deltaY*1.5;
|
||||
const targetScrollLeft = event.deltaY * 1.5;
|
||||
this.scrollTabContainer(targetScrollLeft);
|
||||
});
|
||||
|
||||
@ -671,8 +671,14 @@ export default class TabRowWidget extends BasicWidget {
|
||||
|
||||
this.draggabillies.push(draggabilly);
|
||||
|
||||
let pointerDownTime: number = 0;
|
||||
draggabilly.on("pointerDown", () => {
|
||||
appContext.tabManager.activateNoteContext(tabEl.getAttribute("data-ntx-id"));
|
||||
pointerDownTime = Date.now();
|
||||
});
|
||||
draggabilly.on("pointerUp", () => {
|
||||
if (Date.now() - pointerDownTime < 200) {
|
||||
appContext.tabManager.activateNoteContext(tabEl.getAttribute("data-ntx-id"));
|
||||
}
|
||||
});
|
||||
|
||||
draggabilly.on("dragStart", () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user