PageSourceSearch

https://butler-loftet.dk/cdn/shop/t/456/assets/body-scroll-lock.js?v=175321380821315844821791445760

js butler-loftet.dk collected 2026-10-10 01:44:08 UTC 5,881 bytes, 2 lines download raw bytes

1(function(global,factory){if(typeof define=="function"&&define.amd)define(["exports"],factory);else if(typeof exports!="undefined")factory(exports);else{var mod={exports:{}};factory(mod.exports),global.bodyScrollLock=mod.exports}})(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:this,function(exports2){"use strict";Object.defineProperty(exports2,"__esModule",{value:!0});function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}else return Array.from(arr)}var hasPassiveEvents=!1;if(typeof window!="undefined"){var passiveTestOptions={get passive(){hasPassiveEvents=!0}};window.addEventListener("testPassive",null,passiveTestOptions),window.removeEventListener("testPassive",null,passiveTestOptions)}var isIosDevice=typeof window!="undefined"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),locks=[],documentListenerAdded=!1,initialClientY=-1,previousBodyOverflowSetting=void 0,previousBodyPosition=void 0,previousBodyPaddingRight=void 0,allowTouchMove=function(el){return locks.some(function(lock){return!!(lock.options.allowTouchMove&&lock.options.allowTouchMove(el))})},preventDefault=function(rawEvent){var e=rawEvent||window.event;return allowTouchMove(e.target)||e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)},setOverflowHidden=function(options){if(previousBodyPaddingRight===void 0){var _reserveScrollBarGap=!!options&&options.reserveScrollBarGap===!0,scrollBarGap=window.innerWidth-document.documentElement.clientWidth;if(_reserveScrollBarGap&&scrollBarGap>0){var computedBodyPaddingRight=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);previousBodyPaddingRight=document.body.style.paddingRight,document.body.style.paddingRight=computedBodyPaddingRight+scrollBarGap+"px"}}previousBodyOverflowSetting===void 0&&(previousBodyOverflowSetting=document.body.style.overflow,document.body.style.overflow="hidden")},restoreOverflowSetting=function(){previousBodyPaddingRight!==void 0&&(document.body.style.paddingRight=previousBodyPaddingRight,previousBodyPaddingRight=void 0),previousBodyOverflowSetting!==void 0&&(document.body.style.overflow=previousBodyOverflowSetting,previousBodyOverflowSetting=void 0)},setPositionFixed=function(){return window.requestAnimationFrame(function(){if(previousBodyPosition===void 0){previousBodyPosition={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var _window=window,scrollY=_window.scrollY,scrollX=_window.scrollX,innerHeight=_window.innerHeight;document.body.style.position="fixed",document.body.style.top=-scrollY+"px",document.body.style.left=-scrollX+"px",setTimeout(function(){return window.requestAnimationFrame(function(){var bottomBarHeight=innerHeight-window.innerHeight;bottomBarHeight&&scrollY>=innerHeight&&(document.body.style.top=-(scrollY+bottomBarHeight)+"px")})},300)}})},restorePositionSetting=function(){if(previousBodyPosition!==void 0){var y=-parseInt(document.body.style.top,10),x=-parseInt(document.body.style.left,10);document.body.style.position=previousBodyPosition.position,document.body.style.top=previousBodyPosition.top,document.body.style.left=previousBodyPosition.left,window.scrollTo(x,y),previousBodyPosition=void 0}},isTargetElementTotallyScrolled=function(targetElement){return targetElement?targetElement.scrollHeight-targetElement.scrollTop<=targetElement.clientHeight:!1},handleScroll=function(event,targetElement){var clientY=event.targetTouches[0].clientY-initialClientY;return allowTouchMove(event.target)?!1:targetElement&&targetElement.scrollTop===0&&clientY>0||isTargetElementTotallyScrolled(targetElement)&&clientY<0?preventDefault(event):(event.stopPropagation(),!0)},disableBodyScroll=exports2.disableBodyScroll=function(targetElement,options){if(!targetElement){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!locks.some(function(lock2){return lock2.targetElement===targetElement})){var lock={targetElement:targetElement,options:options||{}};locks=[].concat(_toConsumableArray(locks),[lock]),isIosDevice?setPositionFixed():setOverflowHidden(options),isIosDevice&&(targetElement.ontouchstart=function(event){event.targetTouches.length===1&&(initialClientY=event.targetTouches[0].clientY)},targetElement.ontouchmove=function(event){event.targetTouches.length===1&&handleScroll(event,targetElement)},documentListenerAdded||(document.addEventListener("touchmove",preventDefault,hasPassiveEvents?{passive:!1}:void 0),documentListenerAdded=!0))}},clearAllBodyScrollLocks=exports2.clearAllBodyScrollLocks=function(){isIosDevice&&(locks.forEach(function(lock){lock.targetElement.ontouchstart=null,lock.targetElement.ontouchmove=null}),documentListenerAdded&&(document.removeEventListener("touchmove",preventDefault,hasPassiveEvents?{passive:!1}:void 0),documentListenerAdded=!1),initialClientY=-1),isIosDevice?restorePositionSetting():restoreOverflowSetting(),locks=[]},enableBodyScroll=exports2.enableBodyScroll=function(targetElement){if(!targetElement){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}locks=locks.filter(function(lock){return lock.targetElement!==targetElement}),isIosDevice&&(targetElement.ontouchstart=null,targetElement.ontouchmove=null,documentListenerAdded&&locks.length===0&&(
1document.removeEventListener("touchmove",preventDefault,hasPassiveEvents?{passive:!1}:void 0),documentListenerAdded=!1)),isIosDevice?restorePositionSetting():restoreOverflowSetting()}});
2//# sourceMappingURL=/cdn/shop/t/456/assets/body-scroll-lock.js.map?v=175321380821315844821791445760

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.