Skip to content

Commit 2d68aa0

Browse files
committed
Limit search results to 50
1 parent ffb026d commit 2d68aa0

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

template/search_template.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,24 @@ $(function(){
6464
}
6565
},
6666
position: { my: "right top", at: "right bottom", of: "#search div" },
67-
source: [
68-
{
69-
category: "Syntax",
70-
value: "# single-line comment",
71-
url: "/language/syntax#Single-line_comments"
72-
}, {
73-
category: "Syntax",
74-
value: "#` multi-line comment",
75-
url: "/language/syntax#Multi-line_/_embedded_comments"
76-
}, {
77-
category: "Signature",
78-
value: ";; (long name)",
79-
url: "/type/Signature#index-entry-Long_Names"
80-
},
81-
ITEMS
82-
],
67+
source: function(request, response) {
68+
var items = [
69+
{
70+
category: "Syntax",
71+
value: "# single-line comment",
72+
url: "/language/syntax#Single-line_comments"
73+
}, {
74+
category: "Syntax",
75+
value: "#` multi-line comment",
76+
url: "/language/syntax#Multi-line_/_embedded_comments"
77+
}, {
78+
category: "Signature",
79+
value: ";; (long name)",
80+
url: "/type/Signature#index-entry-Long_Names"
81+
}, ITEMS ];
82+
var results = $.ui.autocomplete.filter(items, request.term);
83+
response(results.slice(0, 50));
84+
},
8385
select: function (event, ui) { window.location.href = ui.item.url; },
8486
autoFocus: true
8587
});

0 commit comments

Comments
 (0)