mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed broken search in Safari <14
This commit is contained in:
parent
de428d1661
commit
bb57ea9b2d
32
material/assets/javascripts/bundle.7353b375.min.js
vendored
Normal file
32
material/assets/javascripts/bundle.7353b375.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
material/assets/javascripts/bundle.7353b375.min.js.map
Normal file
7
material/assets/javascripts/bundle.7353b375.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -223,7 +223,7 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.d892486b.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.7353b375.min.js' | url }}"></script>
|
||||
{% for path in config["extra_javascript"] %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endfor %}
|
||||
|
@ -20,10 +20,15 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { NEVER, Observable, fromEvent, merge } from "rxjs"
|
||||
import {
|
||||
NEVER,
|
||||
Observable,
|
||||
fromEvent,
|
||||
fromEventPattern,
|
||||
merge
|
||||
} from "rxjs"
|
||||
import {
|
||||
filter,
|
||||
map,
|
||||
mapTo,
|
||||
startWith,
|
||||
switchMap
|
||||
@ -36,15 +41,21 @@ import {
|
||||
/**
|
||||
* Watch media query
|
||||
*
|
||||
* Note that although `MediaQueryList.addListener` is deprecated we have to
|
||||
* use it, because it's the only way to ensure proper downward compatibility.
|
||||
*
|
||||
* @see https://bit.ly/3dUBH2m - GitHub issue
|
||||
*
|
||||
* @param query - Media query
|
||||
*
|
||||
* @returns Media observable
|
||||
*/
|
||||
export function watchMedia(query: string): Observable<boolean> {
|
||||
const media = matchMedia(query)
|
||||
return fromEvent<MediaQueryListEvent>(media, "change")
|
||||
return fromEventPattern<boolean>(next => (
|
||||
media.addListener(() => next(media.matches))
|
||||
))
|
||||
.pipe(
|
||||
map(ev => ev.matches),
|
||||
startWith(media.matches)
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user