i2psnark: More search CSS and js

This commit is contained in:
zzz
2023-01-21 16:38:10 -05:00
parent 8d019a7275
commit 37104e30bf
2 changed files with 15 additions and 2 deletions

View File

@@ -11,17 +11,30 @@ function initSearch()
var sch = document.getElementById("search");
if (sch != null) {
var box = document.getElementById("searchbox");
var cxl = document.getElementById("searchcancel");
sch.addEventListener("reset", function(event) {
if (box.value !== "") {
box.value = "";
requestAjax2(-1);
}
cxl.classList.add("disabled");
event.preventDefault();
});
box.addEventListener("input", function(event) {
if (box.value !== "") {
cxl.classList.remove("disabled");
} else {
cxl.classList.add("disabled");
}
requestAjax2(-1);
});
if (box.value !== "") {
cxl.classList.remove("disabled");
} else {
cxl.classList.add("disabled");
}
}
}

View File

@@ -249,10 +249,10 @@ button::-moz-focus-inner, input::-moz-focus-inner {
#searchcancel {
background: url(images/delete.png) 0px center no-repeat;
margin: 2px 4px 2px -28px;
margin: 2px 4px 2px 4px;
color: transparent;
border: none;
width: 12px;
width: 20px;
}
/* end top nav */