Skip to content

Commit

Permalink
Limit search results to 50
Browse files Browse the repository at this point in the history
  • Loading branch information
Altai-man committed Jan 23, 2017
1 parent ffb026d commit 2d68aa0
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions template/search_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,24 @@ $(function(){
}
},
position: { my: "right top", at: "right bottom", of: "#search div" },
source: [
{
category: "Syntax",
value: "# single-line comment",
url: "/language/syntax#Single-line_comments"
}, {
category: "Syntax",
value: "#` multi-line comment",
url: "/language/syntax#Multi-line_/_embedded_comments"
}, {
category: "Signature",
value: ";; (long name)",
url: "/type/Signature#index-entry-Long_Names"
},
ITEMS
],
source: function(request, response) {
var items = [
{
category: "Syntax",
value: "# single-line comment",
url: "/language/syntax#Single-line_comments"
}, {
category: "Syntax",
value: "#` multi-line comment",
url: "/language/syntax#Multi-line_/_embedded_comments"
}, {
category: "Signature",
value: ";; (long name)",
url: "/type/Signature#index-entry-Long_Names"
}, ITEMS ];
var results = $.ui.autocomplete.filter(items, request.term);
response(results.slice(0, 50));
},
select: function (event, ui) { window.location.href = ui.item.url; },
autoFocus: true
});
Expand Down

0 comments on commit 2d68aa0

Please sign in to comment.