Skip to content

Commit 36bd691

Browse files
committed
Go to first entry of Ddox search on enter instead of Google search
1 parent 74806b1 commit 36bd691

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js/ddox.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,13 @@ function performSymbolSearch(maxlen)
128128

129129
$('#symbolSearchResults').show();
130130
}
131+
132+
$(function(){
133+
$("#search-box form").on("submit", function(e) {
134+
var searchResults = $('#symbolSearchResults').children();
135+
if (searchResults.length > 0) {
136+
window.location = searchResults.first().find("a").attr("href");
137+
e.preventDefault();
138+
}
139+
});
140+
});

0 commit comments

Comments
 (0)