@egstad/detect-scroll
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -285,11 +285,12 @@ // modules are defined as an array | ||
value: function init() { | ||
// main scroll event that informs everything | ||
// fetch x&y | ||
if (this.isHorizontal) this.getX(); | ||
if (this.isVertical) this.getY(); // defines custom events to dispatch | ||
(0, _events.eventsInit)(this.el, this.events); // main scroll event that informs everything | ||
this.el.addEventListener('scroll', this.onScroll, { | ||
passive: this.passiveMode | ||
}); // fetch scroll positions | ||
}); // show dispatched events | ||
this.watchScrollPosition(); // defines custom events to dispatch | ||
(0, _events.eventsInit)(this.el, this.events); // show dispatched events | ||
if (this.debugMode && "development" === 'development') { | ||
@@ -300,5 +301,7 @@ console.group('Detect Scroll Debugger'); | ||
console.groupEnd(); | ||
} // reset value if destroyed | ||
} // watch for changes | ||
this.watchScrollPosition(); // reset value if destroyed | ||
this.destroyed = 0; | ||
@@ -568,4 +571,3 @@ this.hasInit = 1; | ||
hori.scrollTo(instanceWindow.y, 0); | ||
} // scrollMinY: () => {}, | ||
// scrollMaxY: () => {}, | ||
} // scrollMaxY: () => {}, | ||
// scrollMinX: () => {}, | ||
@@ -762,3 +764,3 @@ // scrollMaxX: () => {}, | ||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws'; | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "64260" + '/'); | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "63820" + '/'); | ||
@@ -765,0 +767,0 @@ ws.onmessage = function (event) { |
@@ -220,3 +220,3 @@ // modules are defined as an array | ||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws'; | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "64260" + '/'); | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "63820" + '/'); | ||
@@ -223,0 +223,0 @@ ws.onmessage = function (event) { |
@@ -60,3 +60,2 @@ import DetectScroll from '../index.js' | ||
}, | ||
// scrollMinY: () => {}, | ||
// scrollMaxY: () => {}, | ||
@@ -63,0 +62,0 @@ // scrollMinX: () => {}, |
16
index.js
@@ -42,2 +42,9 @@ import { getEl } from './src/getElement' | ||
init() { | ||
// fetch x&y | ||
if (this.isHorizontal) this.getX() | ||
if (this.isVertical) this.getY() | ||
// defines custom events to dispatch | ||
eventsInit(this.el, this.events) | ||
// main scroll event that informs everything | ||
@@ -47,6 +54,3 @@ this.el.addEventListener('scroll', this.onScroll, { | ||
}) | ||
// fetch scroll positions | ||
this.watchScrollPosition() | ||
// defines custom events to dispatch | ||
eventsInit(this.el, this.events) | ||
// show dispatched events | ||
@@ -59,2 +63,6 @@ if (this.debugMode && process.env.NODE_ENV === 'development') { | ||
} | ||
// watch for changes | ||
this.watchScrollPosition() | ||
// reset value if destroyed | ||
@@ -61,0 +69,0 @@ this.destroyed = 0 |
{ | ||
"name": "@egstad/detect-scroll", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A performant and lightweight ES6 module for detecting scroll activity (direction + location) for X and/or Y axis", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
2169868
68
2647
6
9