Inline editing
This commit is contained in:
@ -265,13 +265,26 @@ export class AnimeNotifier {
|
||||
}
|
||||
|
||||
onKeyDown(e: KeyboardEvent) {
|
||||
let activeElement = document.activeElement
|
||||
|
||||
// Ignore hotkeys on input elements
|
||||
switch(document.activeElement.tagName) {
|
||||
switch(activeElement.tagName) {
|
||||
case "INPUT":
|
||||
case "TEXTAREA":
|
||||
return
|
||||
}
|
||||
|
||||
// Disallow Enter key in contenteditables
|
||||
if(activeElement.getAttribute("contenteditable") === "true" && e.keyCode == 13) {
|
||||
if("blur" in activeElement) {
|
||||
activeElement["blur"]()
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
return
|
||||
}
|
||||
|
||||
// F = Search
|
||||
if(e.keyCode == 70) {
|
||||
let search = this.app.find("search") as HTMLInputElement
|
||||
@ -281,6 +294,7 @@ export class AnimeNotifier {
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user