mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Keep search open on enter without selection
This commit is contained in:
parent
a267729084
commit
253596c58d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -39,7 +39,7 @@
|
|||||||
<script src="{{ base_url }}/assets/javascripts/modernizr-e826f8942a.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/modernizr-e826f8942a.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-9011e2d3f8.css">
|
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-4d315b386e.css">
|
||||||
{% if config.extra.palette %}
|
{% if config.extra.palette %}
|
||||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-23f75ab9c7.palette.css">
|
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-23f75ab9c7.palette.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -153,7 +153,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ base_url }}/assets/javascripts/application-f3ab9e5ff8.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/application-683e1b679e.js"></script>
|
||||||
{% set languages = lang.t("search.languages").split(",") %}
|
{% set languages = lang.t("search.languages").split(",") %}
|
||||||
{% if languages | length and languages[0] != "" %}
|
{% if languages | length and languages[0] != "" %}
|
||||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||||
|
@ -290,13 +290,14 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
/* Go to current active/focused link */
|
/* Go to current active/focused link */
|
||||||
const focus = document.querySelector(
|
const focus = document.querySelector(
|
||||||
"[data-md-component=search] [href][data-md-state=active]")
|
"[data-md-component=search] [href][data-md-state=active]")
|
||||||
if (focus instanceof HTMLLinkElement)
|
if (focus instanceof HTMLLinkElement) {
|
||||||
window.location = focus.getAttribute("href")
|
window.location = focus.getAttribute("href")
|
||||||
|
|
||||||
/* Close search */
|
/* Close search */
|
||||||
toggle.checked = false
|
toggle.checked = false
|
||||||
toggle.dispatchEvent(new CustomEvent("change"))
|
toggle.dispatchEvent(new CustomEvent("change"))
|
||||||
query.blur()
|
query.blur()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Escape: close search */
|
/* Escape: close search */
|
||||||
|
Loading…
Reference in New Issue
Block a user