summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--htdocs/mapscript.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/htdocs/mapscript.js b/htdocs/mapscript.js
index ff1d22e..57fa0f8 100644
--- a/htdocs/mapscript.js
+++ b/htdocs/mapscript.js
@@ -292,7 +292,7 @@ function toggle_search() {
search_element.style.overflow = "scroll";
search_element.style.padding = "6px";
search_element.style.height = "100%";
- search_element.innerHTML = '<input style="width:100%;" id="search_query" name="lifo_map_search" type="search" placeholder="Start typing to search..." onkeypress="search(event)"><div id="search_results"></div>' ;
+ search_element.innerHTML = '<input style="width:100%;" id="search_query" name="lifo_map_search" type="search" placeholder="Start typing to search..." oninput="search(event)"><div id="search_results"></div>' ;
}
td = document.getElementById('windowtr').insertCell(0);
@@ -302,7 +302,7 @@ function toggle_search() {
td.id = "searchbar";
td.appendChild(search_element);
- document.getElementById('search_query').focus();
+ document.getElementById('search_query').select();
}
function htmlEntities(str) {
@@ -321,7 +321,9 @@ var default_street_color = "#3388ff";
function search(e) {
var query = document.getElementById("search_query").value;
document.getElementById('search_results').innerHTML = "";
- if (query.length > 0 || e.key == "Enter") {
+ if (true) {
+ if (query.length == 0)
+ query = "!@#$%^&"; // Cheap workaround to (hopefully) match nothing
results = document.createElement("ul");
for (var i = 0; i < layers._layers.length; i++) {
if (!layers._layers[i].layer._layers)