mirror of
https://github.com/lus/pasty.git
synced 2023-08-10 21:13:09 +03:00
Fix tabulator key input
This commit is contained in:
parent
fa7699d17b
commit
a1cd915759
@ -56,6 +56,11 @@ async function loadPaste() {
|
|||||||
const input = document.getElementById("input");
|
const input = document.getElementById("input");
|
||||||
input.classList.remove("hidden");
|
input.classList.remove("hidden");
|
||||||
input.focus();
|
input.focus();
|
||||||
|
window.addEventListener("keydown", function(event) {
|
||||||
|
if (event.keyCode != 9) return;
|
||||||
|
event.preventDefault();
|
||||||
|
input.value += " ";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spinner.surround(loadPaste);
|
spinner.surround(loadPaste);
|
@ -5,7 +5,7 @@ import * as spinner from "./spinner.js";
|
|||||||
|
|
||||||
// setupKeybinds initializes the keybinds for the buttons
|
// setupKeybinds initializes the keybinds for the buttons
|
||||||
export function setupKeybinds() {
|
export function setupKeybinds() {
|
||||||
window.onkeydown = function(event) {
|
window.addEventListener("keydown", function(event) {
|
||||||
// Return if the CTRL key was not pressed
|
// Return if the CTRL key was not pressed
|
||||||
if (!event.ctrlKey) return;
|
if (!event.ctrlKey) return;
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ export function setupKeybinds() {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
element.click();
|
element.click();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// setupButtons configures the click listeners of the buttons
|
// setupButtons configures the click listeners of the buttons
|
||||||
|
Loading…
Reference in New Issue
Block a user