vue-custom-horizontal-sliding
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,1 +0,1 @@ | ||
import $ from"jquery";export default{install:(e,o)=>{e.directive("trix-horizontal-slider",{mounted(e,o,t){console.log("Trix horizontal slider directive bound");let s="sliding";o.value&&(s=o.value);let n=!1;o.modifiers&&o.modifiers.hasOwnProperty("overElement")&&(n=!0);const r=o=>{if(1!==o.which)return;if(e.scrollWidth<=e.clientWidth)return;for(const t in o.path){const s=o.path[t];if(s===e)break;if(!n&&s.classList.contains("trix-slider-selector"))return}let t=o.screenX,r=!1;const i=o=>{r||(r=!0,e.classList.add(s),$(e).css({"scroll-snap-type":"none","scroll-behavior":"unset"}));let n=t-o.screenX;e.scrollLeft+=n,t=o.screenX},l=()=>{e.classList.remove(s),$(e).css({"scroll-snap-type":"","scroll-behavior":""}),document.removeEventListener("mousemove",i),e.removeEventListener("mouseleave",l),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",i),e.addEventListener("mouseleave",l),document.addEventListener("mouseup",l)};e.__onMouseDown__=r,e.addEventListener("mousedown",r)},beforeUnmount(e){e.removeEventListener("mousedown",e.__onMouseDown__),delete e.__onMouseDown__}})}}; | ||
import $ from"jquery";export default{install:(e,o)=>{e.directive("trix-horizontal-slider",{mounted(e,o,t){let s="sliding";o.value&&(s=o.value);let n=!1;o.modifiers&&o.modifiers.hasOwnProperty("overElement")&&(n=!0);const r=o=>{if(1!==o.which)return;if(e.scrollWidth<=e.clientWidth)return;for(const t in o.path){const s=o.path[t];if(s===e)break;if(!n&&s.classList.contains("trix-slider-selector"))return}let t=o.screenX,r=!1;const i=o=>{r||(r=!0,e.classList.add(s),$(e).css({"scroll-snap-type":"none","scroll-behavior":"unset"}));let n=t-o.screenX;e.scrollLeft+=n,t=o.screenX},l=()=>{e.classList.remove(s),$(e).css({"scroll-snap-type":"","scroll-behavior":""}),document.removeEventListener("mousemove",i),e.removeEventListener("mouseleave",l),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",i),e.addEventListener("mouseleave",l),document.addEventListener("mouseup",l)};e.__onMouseDown__=r,e.addEventListener("mousedown",r)},beforeUnmount(e){e.removeEventListener("mousedown",e.__onMouseDown__),delete e.__onMouseDown__}})}}; |
{ | ||
"name": "vue-custom-horizontal-sliding", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -11,3 +11,3 @@ "main": "customHorizontalSliding.min.js", | ||
"type": "git", | ||
"url": "https://github.com/matvejs16/vue-customHorizontalSliding.git" | ||
"url": "git+https://github.com/matvejs16/vue-customHorizontalSliding.git" | ||
}, | ||
@@ -14,0 +14,0 @@ "author": "Matvejs Makusins", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8065