diff options
author | Roland Stigge <stigge@antcom.de> | 2018-01-07 22:20:43 +0100 |
---|---|---|
committer | Roland Stigge <stigge@antcom.de> | 2018-01-07 22:20:43 +0100 |
commit | 34f772d353839b5febcc0cad2a54e29716dcb6c8 (patch) | |
tree | 7f980ab206ae598aa797ab3d973739f6128b2051 /html | |
parent | 5815efb463805465a8b19f9435f0fa62b12761eb (diff) |
Accept input on enter
Diffstat (limited to 'html')
-rw-r--r-- | html/webbox.js | 17 |
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() { |