mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-01 12:27:41 +08:00
fix(tab-row): Optimize tab-row scrolling experience
This commit is contained in:
parent
111258b539
commit
bbc77b522f
@ -386,15 +386,8 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
};
|
};
|
||||||
|
|
||||||
setupScrollEvents() {
|
setupScrollEvents() {
|
||||||
let isScrolling = false;
|
|
||||||
this.$tabScrollingContainer[0].addEventListener('wheel', (event) => {
|
this.$tabScrollingContainer[0].addEventListener('wheel', (event) => {
|
||||||
if (!isScrolling) {
|
this.scrollTabContainer(event.deltaY * 1.5);
|
||||||
isScrolling = true;
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
this.scrollTabContainer(event.deltaY * 1.5, 'instant');
|
|
||||||
isScrolling = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
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