mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Simplify
This commit is contained in:
parent
3ca664ed67
commit
b953001215
1 changed files with 0 additions and 26 deletions
|
|
@ -419,25 +419,6 @@ export default function PdfArticleContainer(
|
|||
}
|
||||
)
|
||||
|
||||
function getActiveElement(element = document.activeElement) {
|
||||
if (element && !('contentDocument' in element)) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const shadowRoot = element?.shadowRoot
|
||||
const contentDocument = element?.contentDocument as Document
|
||||
|
||||
if (shadowRoot && shadowRoot.activeElement) {
|
||||
return getActiveElement(shadowRoot.activeElement)
|
||||
}
|
||||
|
||||
if (contentDocument && contentDocument.activeElement) {
|
||||
return getActiveElement(contentDocument.activeElement)
|
||||
}
|
||||
|
||||
return element
|
||||
}
|
||||
|
||||
function keyDownHandler(event: globalThis.KeyboardEvent) {
|
||||
var inputs = ['input', 'select', 'button', 'textarea']
|
||||
|
||||
|
|
@ -448,13 +429,6 @@ export default function PdfArticleContainer(
|
|||
}
|
||||
}
|
||||
|
||||
var activeElement = event.target
|
||||
if (activeElement && 'nodeName' in activeElement) {
|
||||
if (inputs.indexOf(activeElement.nodeName as string) != -1) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const key = event.key.toLowerCase()
|
||||
switch (key) {
|
||||
case 'o':
|
||||
|
|
|
|||
Loading…
Reference in a new issue