mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Make ;; hint mode change scrolling element
This commit is contained in:
parent
df73304b1d
commit
e0ed570a99
2 changed files with 7 additions and 1 deletions
|
@ -153,6 +153,11 @@ let currentFocused = document.activeElement as any
|
|||
let lastX = 0
|
||||
let lastY = 0
|
||||
|
||||
// export let currentFocused exports it as readonly, so we have to write a function
|
||||
export function setCurrentFocus(v) {
|
||||
currentFocused = v
|
||||
}
|
||||
|
||||
document.addEventListener("mousedown", event => {
|
||||
currentFocused = event.target
|
||||
})
|
||||
|
|
|
@ -3780,7 +3780,7 @@ export function setnull(...keys: string[]) {
|
|||
- -S save the linked image
|
||||
- -a save-as the linked resource
|
||||
- -A save-as the linked image
|
||||
- -; focus an element
|
||||
- -; focus an element and set it as the element or the child of the element to scroll
|
||||
- -# yank an element's anchor URL to clipboard
|
||||
- -c [selector] hint links that match the css selector
|
||||
- `bind ;c hint -c [class*="expand"],[class="togg"]` works particularly well on reddit and HN
|
||||
|
@ -4070,6 +4070,7 @@ export async function hint(option?: string, selectors?: string, ...rest: string[
|
|||
hinting.hintables(selectors),
|
||||
elem => {
|
||||
elem.focus()
|
||||
scrolling.setCurrentFocus(elem)
|
||||
return elem
|
||||
},
|
||||
rapid,
|
||||
|
|
Loading…
Add table
Reference in a new issue