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

}); });


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


}); });


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



+ 1
- 4
web/script.js View File

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




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


function displaySuggestions() { function displaySuggestions() {

+ 5
- 1
web/style.css View File

padding-top: 6px; padding-top: 6px;
padding-bottom: 6px; padding-bottom: 6px;


max-height: 80%;
max-height: 70%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden;
} }
#add .suggestions.hidden { #add .suggestions.hidden {
opacity: 0; opacity: 0;
padding: 12px; padding: 12px;
cursor: pointer; cursor: pointer;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
text-overflow: ellipsis;
max-width: 100%;
overflow: hidden;
} }


#list { #list {

Loading…
Cancel
Save