Merge pull request #991 from dalf/fix-894

Fix 894
This commit is contained in:
Alexandre Flament 2022-03-19 21:20:29 +01:00 committed by GitHub
commit 96605d4330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 7 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -31,10 +31,11 @@
// update status, event listener // update status, event listener
updateClearButton(); updateClearButton();
cs.addEventListener('click', function () { cs.addEventListener('click', function (ev) {
qinput.value = ''; qinput.value = '';
qinput.focus(); qinput.focus();
updateClearButton(); updateClearButton();
ev.preventDefault();
}); });
qinput.addEventListener('keyup', updateClearButton, false); qinput.addEventListener('keyup', updateClearButton, false);
} }

View File

@ -125,6 +125,10 @@
} }
} }
html.no-js #clear_search.hide_if_nojs {
display: none;
}
#q, #q,
#send_search { #send_search {
display: block !important; display: block !important;

View File

@ -6,7 +6,7 @@
</a> </a>
<div class="search_box"> <div class="search_box">
<input id="q" autofocus name="q" type="text" placeholder="{{ _('Search for...') }}" autocomplete="off" spellcheck="false" dir="auto" value="{{ q or '' }}"> <input id="q" autofocus name="q" type="text" placeholder="{{ _('Search for...') }}" autocomplete="off" spellcheck="false" dir="auto" value="{{ q or '' }}">
<button id="clear_search" type="reset" aria-label="{{ _('clear') }}"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button> <button id="clear_search" type="reset" aria-label="{{ _('clear') }}" class="hide_if_nojs"><span>{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button>
<button id="send_search" type="submit" aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button> <button id="send_search" type="submit" aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button>
</div> </div>
{% set display_tooltip = true %} {% set display_tooltip = true %}