jquery use passive listener
This commit is contained in:
parent
57a8b255a6
commit
2b5ac1e3bf
@ -20,6 +20,29 @@
|
|||||||
{{ range .Site.Params.plugins.head_js }}
|
{{ range .Site.Params.plugins.head_js }}
|
||||||
<script src="{{ . | absURL }}" type="text/javascript"></script>
|
<script src="{{ . | absURL }}" type="text/javascript"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
<!-- jquery passive listener fixes -->
|
||||||
|
<script>
|
||||||
|
jQuery.event.special.touchstart = {
|
||||||
|
setup: function( _, ns, handle ) {
|
||||||
|
this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
jQuery.event.special.touchmove = {
|
||||||
|
setup: function( _, ns, handle ) {
|
||||||
|
this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
jQuery.event.special.wheel = {
|
||||||
|
setup: function( _, ns, handle ){
|
||||||
|
this.addEventListener("wheel", handle, { passive: true });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
jQuery.event.special.mousewheel = {
|
||||||
|
setup: function( _, ns, handle ){
|
||||||
|
this.addEventListener("mousewheel", handle, { passive: true });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
|
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user