Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -0,0 +1,6 @@
|
||||
;(function(){"use strict";class IPullToRefresh extends HTMLElement{constructor(){super();}
|
||||
connectedCallback(){this.dragDistance=150;this.swipeObserver.observe(this);}
|
||||
handleEvent(e){requestAnimationFrame(()=>{this.style.setProperty("--_scroll",(window.scrollY>0)?0:window.scrollY);if(window.scrollY<this.dragDistance*-1){document.removeEventListener("scroll",this);document.documentElement.setAttribute("data-ips-pwa-refreshing","");setTimeout(()=>{location.reload();},16);}});}
|
||||
setDragDistance(){this.dragDistance=Math.min(150,window.innerHeight*0.25);this.style.setProperty("--_limit",this.dragDistance);}
|
||||
swipeObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){document.addEventListener("scroll",this);this.setDragDistance();}else{document.removeEventListener("scroll",this);}});},{threshold:.1})}
|
||||
ips.ui.registerWebComponent("pullToRefresh",IPullToRefresh);Debug.log(`Submitted the web component constructor, IPullToRefresh, for ${"pullToRefresh"}`);})();;
|
||||
Reference in new issue
Block a user