Skip to content

Commit a7c59b9

Browse files
committed
Improve search experience
1 parent a5ed30f commit a7c59b9

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

_includes/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
</ul>
7171
<!-- items below float right, so appear in reverse order -->
7272
<div id="search-container">
73-
<form class="navbar-form navbar-right dropdown">
74-
<input type="text" id="search-input" class="form-control" onfocus="searchFocus()" onkeyup="searchTextChanged()" placeholder="Quick nav" onkeypress="this.onkeyup();" onpaste="this.onkeyup();" oninput="this.onkeyup();" autocomplete="off" />
73+
<form class="navbar-form navbar-right dropdown" onsubmit="return false;">
74+
<input type="text" id="search-input" class="form-control" placeholder="Quick nav" autocomplete="off" />
7575
<div class="dropdown-menu" id="search-dropdown">
7676
<div class="search-results-container" id="search-results-docs">
7777
<h2>In docs</h2>

javascripts/search.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ $(document).ready(function () {
2929
hideSearchDropdown();
3030
}
3131
});
32+
33+
$('#search-input')
34+
.focus(searchFocus)
35+
.keyup(searchTextChanged);
36+
37+
3238
});
3339

3440
Array.prototype.clean = function(deleteValue) {
@@ -171,11 +177,13 @@ function doSearch(query) {
171177

172178
resultArea.loadTemplate($('#search-result-template'), results[i], { append: true} );
173179

174-
resultArea.children().last().show(400);
175-
if(i < results.length - 1)
180+
resultArea.children().last().show(20);
181+
182+
if(i < results.length - 1) {
176183
itemLoadTimer = setTimeout(function() {
177184
loadItem(i + 1)
178-
}, 25);
185+
}, 5);
186+
}
179187
}
180188

181189
if(results.length > 0)

0 commit comments

Comments
 (0)