mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
themes: use noscript for search js notification
The "search.html" template will generate a warning admonition about requiring JavaScript for search and automatically hiding the element when supported. While functional, if a client renders the page slowly, the warning notification may be visible to the user for a moment. Instead of relying on JavaScript to suppress this warning, use a `noscript` tag to hide the warning for clients who do not support JavaScript. This also has the benefit of one less JavaScript call required by a client. Signed-off-by: James Knight <james.d.knight@live.com>
This commit is contained in:
parent
293beecc06
commit
e01d914dbd
@ -21,13 +21,14 @@
|
||||
{% block body %}
|
||||
<h1 id="search-documentation">{{ _('Search') }}</h1>
|
||||
{% block scriptwarning %}
|
||||
<div id="fallback" class="admonition warning">
|
||||
<script>$('#fallback').hide();</script>
|
||||
<noscript>
|
||||
<div class="admonition warning">
|
||||
<p>
|
||||
{% trans %}Please activate JavaScript to enable the search
|
||||
functionality.{% endtrans %}
|
||||
</p>
|
||||
</div>
|
||||
</noscript>
|
||||
{% endblock %}
|
||||
{% block searchtext %}
|
||||
<p>
|
||||
|
Loading…
Reference in New Issue
Block a user