Browse Source

no longer unfocuses the input when using the keyboard to enter text, and other fixes

master
mortie 7 years ago
parent
commit
3584190778
3 changed files with 8 additions and 7 deletions
  1. 2
    2
      server.js
  2. 1
    4
      web/script.js
  3. 5
    1
      web/style.css

+ 2
- 2
server.js View File

@@ -28,7 +28,7 @@ app.get("/words", (req, res) => {
});

app.post("/remove/:index", (req, res) => {
res.end();
res.json({});
if (!req.params.index)
return;

@@ -52,7 +52,7 @@ app.post("/remove/:index", (req, res) => {
});

app.post("/add/:name", (req, res) => {
res.end();
res.json({});
if (!req.params.name)
return;


+ 1
- 4
web/script.js View File

@@ -11,7 +11,7 @@ elemSuggestions.hide = function() {
elemSuggestions.className = "suggestions hidden";
setTimeout(function() {
elemSuggestions.style.display = "none";
}, 500);
}, 100);
}
elemSuggestions.hide();

@@ -125,9 +125,6 @@ elemAdd.addEventListener("submit", function(evt) {

post("/add/"+encodeURIComponent(elemName.value));
elemName.value = "";
setTimeout(function() {
elemName.blur();
}, 1);
});

function displaySuggestions() {

+ 5
- 1
web/style.css View File

@@ -59,8 +59,9 @@ html, body {
padding-top: 6px;
padding-bottom: 6px;

max-height: 80%;
max-height: 70%;
overflow-y: auto;
overflow-x: hidden;
}
#add .suggestions.hidden {
opacity: 0;
@@ -72,6 +73,9 @@ html, body {
padding: 12px;
cursor: pointer;
border-bottom: 1px solid #ccc;
text-overflow: ellipsis;
max-width: 100%;
overflow: hidden;
}

#list {

Loading…
Cancel
Save