8209914: javadoc search sometimes generates bad URIs

Reviewed-by: jjg
This commit is contained in:
Hannes Wallnöfer 2018-09-14 14:45:31 +02:00
parent 8eb4ba001c
commit 9a9df3cd76

View File

@ -132,24 +132,18 @@ $.widget("custom.catcomplete", $.ui.autocomplete, {
} else {
label = item.l;
}
$li = $("<li/>").appendTo(ul);
var li = $("<li/>").appendTo(ul);
if (item.category === catSearchTags) {
if (item.d) {
$("<a/>").attr("href", "#")
.html(label + "<span class=\"searchTagHolderResult\"> (" + item.h + ")</span><br><span class=\"searchTagDescResult\">"
+ item.d + "</span><br>")
.appendTo($li);
li.html(label + "<span class=\"searchTagHolderResult\"> (" + item.h + ")</span><br><span class=\"searchTagDescResult\">"
+ item.d + "</span><br>");
} else {
$("<a/>").attr("href", "#")
.html(label + "<span class=\"searchTagHolderResult\"> (" + item.h + ")</span>")
.appendTo($li);
li.html(label + "<span class=\"searchTagHolderResult\"> (" + item.h + ")</span>");
}
} else {
$("<a/>").attr("href", "#")
.html(label)
.appendTo($li);
li.html(label);
}
return $li;
return li;
}
});
$(function() {
@ -328,6 +322,7 @@ $(function() {
} else {
window.location.href = pathtoroot + url;
}
$("#search").focus();
}
}
});