mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-28 16:01:32 +08:00
fix(tab-row): Remove shift+wheel tab switching
This commit is contained in:
parent
be8ee350cb
commit
7b1c6807ba
@ -400,7 +400,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.$tabScrollingContainer[0].addEventListener('wheel', async (event) => {
|
this.$tabScrollingContainer[0].addEventListener('wheel', async (event) => {
|
||||||
if (utils.isCtrlKey(event) || event.altKey) {
|
if (utils.isCtrlKey(event) || event.altKey || event.shiftKey) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -410,7 +410,6 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
// no lower limit is set because touchpad deltas are usually small
|
// no lower limit is set because touchpad deltas are usually small
|
||||||
const delta = Math.sign(event.deltaX + event.deltaY) * Math.min(Math.abs(event.deltaX + event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3);
|
const delta = Math.sign(event.deltaX + event.deltaY) * Math.min(Math.abs(event.deltaX + event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3);
|
||||||
|
|
||||||
if (!event.shiftKey) {
|
|
||||||
// Check if the device has reduced motion enabled
|
// Check if the device has reduced motion enabled
|
||||||
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
||||||
this.scrollTabContainer(delta, "instant");
|
this.scrollTabContainer(delta, "instant");
|
||||||
@ -421,14 +420,6 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
stepScroll();
|
stepScroll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (event.shiftKey) {
|
|
||||||
if (delta > 0) {
|
|
||||||
await appContext.tabManager.activateNextTabCommand();
|
|
||||||
} else {
|
|
||||||
await appContext.tabManager.activatePreviousTabCommand();
|
|
||||||
}
|
|
||||||
this.activeTabEl.scrollIntoView();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200));
|
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user