mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
commit
12ef314ab7
@ -285,6 +285,7 @@ const TAB_ROW_TPL = `
|
|||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
scrollbar-width: none; /* Firefox */
|
scrollbar-width: none; /* Firefox */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Chrome/Safari */
|
/* Chrome/Safari */
|
||||||
.tab-row-widget-scrolling-container::-webkit-scrollbar {
|
.tab-row-widget-scrolling-container::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
@ -391,15 +392,12 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopImmediatePropagation();
|
||||||
const delta = Math.sign(wheelEvent.deltaX + wheelEvent.deltaY) *
|
event.currentTarget.scrollLeft += wheelEvent.deltaY + wheelEvent.deltaX;
|
||||||
Math.min(Math.abs(wheelEvent.deltaX + wheelEvent.deltaY), TAB_CONTAINER_MIN_WIDTH * 2);
|
|
||||||
|
|
||||||
this.scrollTabContainer(delta, "instant");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200));
|
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-210));
|
||||||
this.$scrollButtonRight[0].addEventListener('click', () => this.scrollTabContainer(200));
|
this.$scrollButtonRight[0].addEventListener('click', () => this.scrollTabContainer(210));
|
||||||
|
|
||||||
this.$tabScrollingContainer[0].addEventListener('scroll', () => {
|
this.$tabScrollingContainer[0].addEventListener('scroll', () => {
|
||||||
clearTimeout(this.updateScrollTimeout);
|
clearTimeout(this.updateScrollTimeout);
|
||||||
@ -731,7 +729,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
|
|
||||||
const scorllContainerBounds = this.$tabScrollingContainer[0]?.getBoundingClientRect();
|
const scorllContainerBounds = this.$tabScrollingContainer[0]?.getBoundingClientRect();
|
||||||
const pointerX = pointer.pageX;
|
const pointerX = pointer.pageX;
|
||||||
const scrollSpeed = 100; // The increment of each scroll.
|
const scrollSpeed = 105; // The increment of each scroll.
|
||||||
// Check if the mouse is near the edge of the container and trigger scrolling.
|
// Check if the mouse is near the edge of the container and trigger scrolling.
|
||||||
if (pointerX < scorllContainerBounds.left) {
|
if (pointerX < scorllContainerBounds.left) {
|
||||||
this.scrollTabContainer(- scrollSpeed);
|
this.scrollTabContainer(- scrollSpeed);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user