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>
|
||||
{% endblock %}
|
||||
{% 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 %}
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-23f75ab9c7.palette.css">
|
||||
{% endif %}
|
||||
@ -153,7 +153,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% 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(",") %}
|
||||
{% if languages | length and languages[0] != "" %}
|
||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||
|
@ -290,7 +290,7 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
/* Go to current active/focused link */
|
||||
const focus = document.querySelector(
|
||||
"[data-md-component=search] [href][data-md-state=active]")
|
||||
if (focus instanceof HTMLLinkElement)
|
||||
if (focus instanceof HTMLLinkElement) {
|
||||
window.location = focus.getAttribute("href")
|
||||
|
||||
/* Close search */
|
||||
@ -298,6 +298,7 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
toggle.dispatchEvent(new CustomEvent("change"))
|
||||
query.blur()
|
||||
}
|
||||
}
|
||||
|
||||
/* Escape: close search */
|
||||
} else if (ev.keyCode === 27) {
|
||||
|
Loading…
Reference in New Issue
Block a user