summaryrefslogtreecommitdiffhomepage
path: root/html
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2018-01-07 22:20:43 +0100
committerRoland Stigge <stigge@antcom.de>2018-01-07 22:20:43 +0100
commit34f772d353839b5febcc0cad2a54e29716dcb6c8 (patch)
tree7f980ab206ae598aa797ab3d973739f6128b2051 /html
parent5815efb463805465a8b19f9435f0fa62b12761eb (diff)
Accept input on enter
Diffstat (limited to 'html')
-rw-r--r--html/webbox.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/html/webbox.js b/html/webbox.js
index 52e8563..071137c 100644
--- a/html/webbox.js
+++ b/html/webbox.js
@@ -242,9 +242,10 @@ function initMainpage() {
document.onkeydown = function(evt) {
if (evt.key == "Escape") {
hideDialog();
+ hideMenu();
}
- };
-
+ }
+
// load title
var xhrTitle = new XMLHttpRequest();
@@ -367,6 +368,12 @@ function createDir() {
document.getElementById("dialog").innerHTML = document.getElementById("create-dir-dialog").innerHTML;
document.getElementById("newdir").focus();
+
+ document.getElementById("newdir").onkeydown = function(evt) {
+ if (evt.key == "Enter") {
+ document.getElementById("okbutton").click();
+ }
+ }
}
function upload() {
@@ -464,6 +471,12 @@ function move() {
document.getElementById("dialog").innerHTML = document.getElementById("move-dialog").innerHTML;
document.getElementById("movedir").focus();
+ document.getElementById("movedir").onkeydown = function(evt) {
+ if (evt.key == "Enter") {
+ document.getElementById("okbutton").click();
+ }
+ }
+
document.getElementById("movefiles").innerHTML = message;
document.getElementById("okbutton").onclick = function() {