Skip to content

Commit 6af66ca

Browse files
committed
In documentation, add about section when searching
This commit hides the about section when the search bar is not empty, making it more discoverable to users that search is indeed working and they should look in the options section.
1 parent ee2bed9 commit 6af66ca

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

docs/index.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
<script src="https://unpkg.com/[email protected]"></script>
1111
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/highlight.min.js"></script>
1212
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js"></script>
13+
<script>
14+
function hideHeaderIfSearching() {
15+
var x = document.getElementById("search");
16+
17+
var myDiv = document.getElementById("about");
18+
if (x.value != "")
19+
{
20+
myDiv.style.display = "none";
21+
} else {
22+
myDiv.style.display = "block";
23+
}
24+
}
25+
</script>
1326
<style>
1427
@media (max-width: 767px) {
1528
.markdown-body {
@@ -61,7 +74,7 @@
6174
<form style="display:flex;">
6275
<label for="search" style="margin-right: 3px;" >search:</label>
6376
<div style="position: relative;">
64-
<input id="search" placeholder="Search all options" v-model="searchCondition">
77+
<input id="search" placeholder="Search all options" v-model="searchCondition" onkeyup="hideHeaderIfSearching()">
6578
<svg style="position: absolute; left: 8px; top: 7px;" class="octicon octicon-search subnav-search-icon" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true">
6679
<path fill-rule="evenodd" d="M15.7 13.3l-3.81-3.83A5.93 5.93 0 0 0 13 6c0-3.31-2.69-6-6-6S1 2.69 1 6s2.69 6 6 6c1.3 0 2.48-.41 3.47-1.11l3.83 3.81c.19.2.45.3.7.3.25 0 .52-.09.7-.3a.996.996 0 0 0 0-1.41v.01zM7 10.7c-2.59 0-4.7-2.11-4.7-4.7 0-2.59 2.11-4.7 4.7-4.7 2.59 0 4.7 2.11 4.7 4.7 0 2.59-2.11 4.7-4.7 4.7z"></path>
6780
</svg>
@@ -81,7 +94,7 @@
8194
</select>
8295
</div>
8396
</div>
84-
<div v-html="aboutHtml"></div>
97+
<div v-html="aboutHtml" id="about"></div>
8598
<div v-html="configurationAboutHtml"></div>
8699
<div v-html="outputHtml"></div>
87100
</article>

0 commit comments

Comments
 (0)