mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
WIP: add setting to switch elements manually
This commit is contained in:
parent
fcdcdc028f
commit
a155c38d5b
2 changed files with 14 additions and 0 deletions
|
@ -186,6 +186,15 @@ export async function recursiveScroll(
|
|||
const sameSignX = xDistance < 0 === lastX < 0
|
||||
const sameSignY = yDistance < 0 === lastY < 0
|
||||
const sameElement = lastFocused == currentFocused
|
||||
if (
|
||||
lastRecursiveScrolled &&
|
||||
config.get("scrollswitch") === "manual" &&
|
||||
((currentFocused && currentFocused == lastRecursiveScrolled) ||
|
||||
!currentFocused)
|
||||
) {
|
||||
scroll(xDistance, yDistance, lastRecursiveScrolled)
|
||||
return true
|
||||
}
|
||||
if (lastRecursiveScrolled && sameSignX && sameSignY && sameElement) {
|
||||
// We're scrolling in the same direction as the previous time so
|
||||
// let's try to pick up from where we left
|
||||
|
|
|
@ -763,6 +763,11 @@ export class default_config {
|
|||
*/
|
||||
scrollduration = 100
|
||||
|
||||
/**
|
||||
* Whether scrolling should change elements automatically once the bottom is reached
|
||||
*/
|
||||
scrollswitch: "manual" | "auto" = "auto"
|
||||
|
||||
/**
|
||||
* Where to open tabs opened with `tabopen` - to the right of the current tab, or at the end of the tabs.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue