mirror of
https://github.com/vrana/adminer.git
synced 2025-08-17 12:00:41 +02:00
Respect numbers in autocomplete
This commit is contained in:
@@ -18,16 +18,17 @@ function whisperClick(event, field) {
|
||||
}
|
||||
|
||||
function whisper(url, field) {
|
||||
if (field.orig != field.value) {
|
||||
if (field.orig != field.value) { // ignore arrows, Shift, ...
|
||||
field.orig = field.value;
|
||||
field.previousSibling.value = field.value; // accept number, reject string
|
||||
return ajax(url + encodeURIComponent(field.value), function (xmlhttp) {
|
||||
if (xmlhttp.status && field.orig == field.value) {
|
||||
if (xmlhttp.status && field.orig == field.value) { // ignore old responses
|
||||
field.nextSibling.innerHTML = xmlhttp.responseText;
|
||||
field.nextSibling.style.display = '';
|
||||
var a = field.nextSibling.firstChild;
|
||||
if (a && a.firstChild.data == field.value) {
|
||||
field.previousSibling.value = decodeURIComponent(a.href.replace(/.*=/, ''));
|
||||
a.style.fontWeight = 'bold';
|
||||
a.className = 'active';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user