mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
fix: keyboard shortcut to confirm prompts (#2932)
This commit is contained in:
parent
62f0dfb302
commit
ff9502ff34
@ -62,17 +62,16 @@ export default {
|
||||
window.addEventListener("keydown", (event) => {
|
||||
if (this.currentPrompt == null) return;
|
||||
|
||||
let prompt = this.$refs.currentComponent;
|
||||
const promptName = this.currentPrompt.prompt;
|
||||
const prompt = this.$refs[promptName];
|
||||
|
||||
// Esc!
|
||||
if (event.keyCode === 27) {
|
||||
if (event.code === "Escape") {
|
||||
event.stopImmediatePropagation();
|
||||
this.$store.commit("closeHovers");
|
||||
}
|
||||
|
||||
// Enter
|
||||
if (event.keyCode == 13) {
|
||||
switch (this.currentPrompt.prompt) {
|
||||
if (event.code === "Enter") {
|
||||
switch (promptName) {
|
||||
case "delete":
|
||||
prompt.submit();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user