mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Reverted addEventListener for media query (hello iOS Safari, I'm looking at you)
This commit is contained in:
parent
a127eec88d
commit
0c4ddfcd70
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
material/assets/javascripts/bundle.a50b2d70.min.js
vendored
Normal file
2
material/assets/javascripts/bundle.a50b2d70.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/javascripts/bundle.a50b2d70.min.js.map
Normal file
1
material/assets/javascripts/bundle.a50b2d70.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.68692be8.min.js",
|
||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.68692be8.min.js.map",
|
||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.a50b2d70.min.js",
|
||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.a50b2d70.min.js.map",
|
||||
"assets/javascripts/vendor.js": "assets/javascripts/vendor.bdf98b33.min.js",
|
||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.bdf98b33.min.js.map",
|
||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.e0a2b82c.min.js",
|
||||
|
@ -173,7 +173,7 @@
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/vendor.bdf98b33.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.68692be8.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.a50b2d70.min.js' | url }}"></script>
|
||||
{%- set translations = {} -%}
|
||||
{%- for key in [
|
||||
"clipboard.copy",
|
||||
|
@ -20,8 +20,8 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { Observable, fromEvent } from "rxjs"
|
||||
import { map, shareReplay, startWith } from "rxjs/operators"
|
||||
import { Observable } from "rxjs"
|
||||
import { shareReplay, startWith } from "rxjs/operators"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Functions
|
||||
@ -36,9 +36,10 @@ import { map, shareReplay, startWith } from "rxjs/operators"
|
||||
*/
|
||||
export function watchMedia(query: string): Observable<boolean> {
|
||||
const media = matchMedia(query)
|
||||
return fromEvent<MediaQueryListEvent>(media, "change")
|
||||
return new Observable<boolean>(subscriber => {
|
||||
media.addListener(ev => subscriber.next(ev.matches))
|
||||
})
|
||||
.pipe(
|
||||
map(ev => ev.matches),
|
||||
startWith(media.matches),
|
||||
shareReplay({ bufferSize: 1, refCount: true })
|
||||
)
|
||||
|
@ -83,7 +83,7 @@ export function patchScrollfix(
|
||||
iif(isAppleDevice, els$, NEVER)
|
||||
.pipe(
|
||||
switchMap(els => merge(...els.map(el => (
|
||||
fromEvent(el, "touchstart", { passive: true })
|
||||
fromEvent(el, "touchstart")
|
||||
.pipe(
|
||||
mapTo(el)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user