Skip to content

Commit c37637e

Browse files
committed
Fix browser-specific CSS alignment error and add search delay
1 parent e4b644b commit c37637e

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

_config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ defaults:
2929
categories: "tutorials docs"
3030
-
3131
scope:
32-
path: "docs/drivers"
32+
path: "docs/sensors"
3333
type: "pages"
3434
values:
35-
category: "drivers"
35+
categories: "sensors docs"
3636
-
3737
scope:
38-
path: "docs/sensors"
38+
path: "docs/motors"
3939
type: "pages"
4040
values:
41-
categories: "sensors docs"
41+
categories: "motors docs"
4242
-
4343
scope:
4444
path: ""

_includes/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<a href="{{ site.github.url }}/contributing" title="How to contribute to ev3dev">Contributing</a>
1818
</li>
1919
<!-- items below float right, so appear in reverse order -->
20-
<li class="right headerBox" id="search-li">
21-
<input type="text" id="search-input" onfocus="searchFocus()" onkeyup="searchUpdate()" placeholder="Quick Nav" onkeypress="this.onkeyup();" onpaste="this.onkeyup();" oninput="this.onkeyup();" />
20+
<li class="right header-box" id="search-li">
21+
<input type="text" id="search-input" onfocus="searchFocus()" onkeyup="searchTextChanged()" placeholder="Quick Nav" onkeypress="this.onkeyup();" onpaste="this.onkeyup();" oninput="this.onkeyup();" />
2222
<div id="search-dropdown">
2323
<div class="search-results-container" id="search-results-docs">
2424
<h2>In docs</h2>

javascripts/search.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ layout:
44

55
var searchData;
66
var dataLoading = false;
7-
var itemLoadTimer;
7+
var itemLoadTimer, searchKeystrokeEventTimer;
88

99
var projectResultArea, docResultArea, miscResultArea;
1010
$(document).ready(function () {
@@ -53,6 +53,16 @@ function searchFocus() {
5353
searchUpdate();
5454
}
5555

56+
function searchTextChanged() {
57+
if(searchKeystrokeEventTimer != undefined)
58+
clearTimeout(searchKeystrokeEventTimer);
59+
60+
searchKeystrokeEventTimer = setTimeout(function() {
61+
searchKeystrokeEventTimer = undefined;
62+
searchUpdate();
63+
}, 400);
64+
}
65+
5666
//Loads the data from the JSON document
5767
function loadSearchData(callback) {
5868
if (dataLoading)

stylesheets/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,7 @@ dt {
813813
margin: 6px auto;
814814
}
815815

816-
.headerBox {
817-
line-height: 50px;
816+
.header-box {
818817
list-style: none;
819818
}
820819

@@ -848,6 +847,7 @@ dt {
848847
#search-dropdown {
849848
position: relative;
850849
left: -180px;
850+
top: 8px;
851851
width: 320px;
852852

853853
max-height: 500px;

0 commit comments

Comments
 (0)