mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(tab-row): Simplify scrolling logic
This commit is contained in:
parent
ebb1654d0e
commit
de4f0f7d6f
@ -285,6 +285,7 @@ const TAB_ROW_TPL = `
|
||||
overflow-y: hidden;
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
/* Chrome/Safari */
|
||||
.tab-row-widget-scrolling-container::-webkit-scrollbar {
|
||||
display: none;
|
||||
@ -391,11 +392,7 @@ export default class TabRowWidget extends BasicWidget {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
|
||||
const delta = Math.sign(wheelEvent.deltaX + wheelEvent.deltaY) *
|
||||
Math.min(Math.abs(wheelEvent.deltaX + wheelEvent.deltaY), TAB_CONTAINER_MIN_WIDTH * 2);
|
||||
|
||||
this.scrollTabContainer(delta, "instant");
|
||||
event.currentTarget.scrollLeft += wheelEvent.deltaY + wheelEvent.deltaX;
|
||||
});
|
||||
|
||||
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200));
|
||||
|
Loading…
x
Reference in New Issue
Block a user