PageSourceSearch

https://u2b.ru/local/templates/aspro-premier/js/dragscroll.min.js

js u2b.ru collected 2026-10-05 18:38:52 UTC 5,337 bytes, 1 lines download raw bytes

1class JSDragScroll{constructor(element,option={}){this.setOption(option),"object"==typeof element?this.wrapEl=element:"string"==typeof element&&(this.wrapEl=document.querySelector(element)),this.activeClass=this.option.activeClass,this.scrollSpeed=this.option.scrollSpeed,this.cancelClickSpace=this.option.cancelClickSpace,this.arrowSpeed=this.option.arrowSpeed,this.wrapEl.classList.add("drag-scroll"),this.el=this.wrapEl.querySelector(".drag-scroll__content"),this.el&&this.el instanceof Node?this.init():console.log("incorect params")}init(){this.isDown=!1,this.startX=0,this.scrollLeft=0,this.cancelClick=!1,this.translateX=0,this.scrollable=!1,this.appendArrows(),this.bindEvents(),this.checkArrows()}setOption(option){const optionDefault={activeClass:"drag-scroll--active",scrollSpeed:1,cancelClickSpace:10,arrowSpeed:75};this.option=Object.assign({},optionDefault,option)}appendArrows(){var arrow_svg='<svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L1 11" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';let arrows_wrapper='<div class="drag-scroll__arrows"><div class="drag-scroll__arrow drag-scroll__arrow--left stroke-dark-light drag-scroll__arrow--disabled">'+arrow_svg+'</div><div class="drag-scroll__arrow drag-scroll__arrow--right stroke-dark-light drag-scroll__arrow--disabled">'+arrow_svg+"</div></div>";this.wrapEl.insertAdjacentHTML("beforeend",arrows_wrapper),this.arrowLeft=this.wrapEl.querySelector(".drag-scroll__arrow--left"),this.arrowRight=this.wrapEl.querySelector(".drag-scroll__arrow--right")}removeArrows(){let arrows=this.wrapEl.querySelector(".drag-scroll__arrows");arrows&&arrows.remove()}checkArrows(){let showArrows=!1;this.translateX>=0?this.arrowLeft.classList.add("drag-scroll__arrow--disabled"):(this.arrowLeft.classList.remove("drag-scroll__arrow--disabled"),showArrows=!0),this.translateX<=this.el.clientWidth-this.el.scrollWidth?this.arrowRight.classList.add("drag-scroll__arrow--disabled"):(this.arrowRight.classList.remove("drag-scroll__arrow--disabled"),showArrows=!0),showArrows?(this.scrollable=!0,this.wrapEl.classList.add("drag-scroll--scrollable")):(this.scrollable=!1,this.wrapEl.classList.remove("drag-scroll--scrollable"))}setScroll(){this.translateX>0?this.translateX=0:this.translateX<this.el.clientWidth-this.el.scrollWidth&&(this.translateX=this.el.clientWidth-this.el.scrollWidth),this.el.style.transform="translateX("+this.translateX+"px)"}onResize(){this.setScroll(),this.checkArrows()}bindEvents(){this.wrapEl.addEventListener("mousedown",BX.proxy(this.onMousedown,this)),this.wrapEl.addEventListener("touchstart",BX.proxy(this.onTouchstart,this)),this.el.addEventListener("click",BX.proxy(this.onClick,this)),document.addEventListener("mouseup",BX.proxy(this.onMouseup,this)),document.addEventListener("touchend",BX.proxy(this.onTouchend,this)),document.addEventListener("mousemove",BX.proxy(this.onMousemove,this)),document.addEventListener("touchmove",BX.proxy(this.onTouchmove,this)),this.arrowLeft&&this.arrowLeft.addEventListener("click",BX.proxy(this.onArrowLeftClick,this)),this.arrowRight&&this.arrowRight.addEventListener("click",BX.proxy(this.onArrowRightClick,this)),window.addEventListener("resize",BX.proxy(this.onResize,this))}onMousedown(e){e.target.closest(".drag-scroll__arrow")||this.startAction(e.pageX)}onTouchstart(){e.target.closest(".drag-scroll__arrow")||this.startAction(e.touches[0].pageX)}onClick(e){this.cancelClick&&e.preventDefault()}onMouseup(){this.isDown&&this.endAction()}onTouchend(){this.isDown&&this.endAction()}onMousemove(e){this.isDown&&(e.preventDefault(),this.moveAction(e.pageX))}onTouchmove(e){this.isDown&&this.moveAction(e.touches[0].pageX)}onArrowRightClick(){this.translateX=this.translateX-this.arrowSpeed,this.checkArrows(),this.el.style["transition-duration"]="200ms",this.setScroll()}onArrowLeftClick(){this.translateX=this.translateX+this.arrowSpeed,this.checkArrows(),this.el.style["transition-duration"]="200ms",this.setScroll()}unBindEvents(){this.wrapEl.removeEventListener("mousedown",BX.proxy(this.onMousedown,this)),this.wrapEl.removeEventListener("touchstart",BX.proxy(this.onTouchstart,this)),this.el.removeEventListener("click",BX.proxy(this.onClick,this)),document.removeEventListener("mouseup",BX.proxy(this.onMouseup,this)),document.removeEventListener("touchend",BX.proxy(this.onTouchend,this)),document.removeEventListener("mousemove",BX.proxy(this.onMousemove,this)),document.removeEventListener("touchmove",BX.proxy(this.onTouchmove,this)),this.arrowLeft&&this.arrowLeft.removeEventListener("click",BX.proxy(this.onArrowLeftClick,this)),this.arrowRight&&this.arrowRight.removeEventListener("click",BX.proxy(this.onArrowRightClick,this)),window.removeEventListener("resize",BX.proxy(this.onResize,this))}destroy(){this.unBindEvents(),this.removeArrows()}moveAction(pageX){const walk=(pageX-this.startX)*this.scrollSpeed;this.translateX=walk,this.setScroll(),this.cancelClick||(this.cancelClick=Math.abs(walk)>this.cancelClickSpace),this.checkArrows()}startAction(pageX){this.scrollable&&(this.isDown=!0,this.cancelClick=!1,this.wrapEl.classList.add(this.activeClass),this.el.style["transition-duration"]="0ms",this.startX=pageX-this.translateX)}endAction(){this.isDown=!1,this.wrapEl.classList.remove(this.activeClass)}}

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.