Skip to content

Commit 48c0102

Browse files
committed
fix reset button
1 parent 2e8ae3d commit 48c0102

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

docs/_static/search_shortcut.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
$('#q').focus();
1313
}
1414
});
15+
16+
// $("button[type='reset']").on('click',function () {
17+
// const formInputs = $('#search-form').find('.form-check-input');
18+
// if(formInputs.length) {
19+
// formInputs.prop('checked',false);
20+
// formInputs.find('#doc_section_all').prop('checked',true);
21+
// }
22+
// });
1523
} else {
1624
$(document).keydown(function(event) {
1725
if ((event.ctrlKey || event.metaKey) && event.key == "k") {

docs/_templates/search.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,25 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
6262
aria-labelledby="{{ _(theme_search_bar_text) }}"
6363
value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
6464
/>
65+
<div class="input-group-append">
66+
<button
67+
type="reset"
68+
class="btn btn-light"
69+
><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-x" viewBox="0 0 16 16">
70+
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/>
71+
</svg></button>
72+
</div>
6573
<div class="input-group-append">
6674
<button type="submit" class="btn btn-primary">{{ _('search') }}</button>
6775
</div>
68-
<!-- <div class="input-group-append">
69-
<button
70-
type="button"
71-
class="clear_search btn btn-secondary"
72-
>{{ _('reset') }}</button>
73-
</div> -->
7476
</div>
7577
</div>
7678

7779
<div class="form row mb-2">
7880
<label for="doc_section" class="col sr-only">Filter by section</label>
7981
<div class="col">
8082
<div class="form-check">
81-
<input class="form-check-input" type="radio" name="doc_section" id="doc_section_all" value="all">
83+
<input class="form-check-input" type="radio" name="doc_section" id="doc_section_all" value="all" checked>
8284
<label class="form-check-label" for="doc_section_all">
8385
All Documentation
8486
</label>

0 commit comments

Comments
 (0)