mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-03 02:36:39 +08:00
1 line
2.9 KiB
JavaScript
1 line
2.9 KiB
JavaScript
(window["RCDLjsonFunction"]=window["RCDLjsonFunction"]||[]).push([[108],{840:function(e,t,o){var n,i,r;!function(o,l){if(true)!(i=[t],n=l,r=typeof n==="function"?n.apply(t,i):n,r!==undefined&&(e.exports=r));else{var c}}(this,(function(e){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}return Array.from(e)}Object.defineProperty(e,"__esModule",{value:!0});var t=!1;if("undefined"!=typeof window){var n={get passive(){t=!0}};window.addEventListener("testPassive",null,n),window.removeEventListener("testPassive",null,n)}function d(e){return l.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))}function c(e){var t=e||window.event;return!!d(t.target)||(1<t.touches.length||(t.preventDefault&&t.preventDefault(),!1))}function o(){setTimeout((function(){void 0!==v&&(document.body.style.paddingRight=v,v=void 0),void 0!==s&&(document.body.style.overflow=s,s=void 0)}))}var r="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&1<window.navigator.maxTouchPoints),l=[],u=!1,a=-1,s=void 0,v=void 0;e.disableBodyScroll=function(e,o){if(r){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(e&&!l.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:o||{}};l=[].concat(i(l),[n]),e.ontouchstart=function(e){1===e.targetTouches.length&&(a=e.targetTouches[0].clientY)},e.ontouchmove=function(t){var o,n,i,r;1===t.targetTouches.length&&(n=e,r=(o=t).targetTouches[0].clientY-a,d(o.target)||(n&&0===n.scrollTop&&0<r||(i=n)&&i.scrollHeight-i.scrollTop<=i.clientHeight&&r<0?c(o):o.stopPropagation()))},u||(document.addEventListener("touchmove",c,t?{passive:!1}:void 0),u=!0)}}else{m=o,setTimeout((function(){if(void 0===v){var e=!!m&&!0===m.reserveScrollBarGap,t=window.innerWidth-document.documentElement.clientWidth;e&&0<t&&(v=document.body.style.paddingRight,document.body.style.paddingRight=t+"px")}void 0===s&&(s=document.body.style.overflow,document.body.style.overflow="hidden")}));var f={targetElement:e,options:o||{}};l=[].concat(i(l),[f])}var m},e.clearAllBodyScrollLocks=function(){r?(l.forEach((function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null})),u&&(document.removeEventListener("touchmove",c,t?{passive:!1}:void 0),u=!1),l=[],a=-1):(o(),l=[])},e.enableBodyScroll=function(e){if(r){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,l=l.filter((function(t){return t.targetElement!==e})),u&&0===l.length&&(document.removeEventListener("touchmove",c,t?{passive:!1}:void 0),u=!1)}else(l=l.filter((function(t){return t.targetElement!==e}))).length||o()}}))}}]); |