@egstad/detect-scroll
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -188,3 +188,4 @@ // modules are defined as an array | ||
else if (eventOverrides && !typeOf(eventOverrides)) { | ||
console.error("Whoops! 'events' must be an object with at least one prop."); | ||
// console.error(`Whoops! 'events' must be an object with at least one prop.`) | ||
return; | ||
} // defaults | ||
@@ -346,3 +347,3 @@ else { | ||
value: function getY() { | ||
return this.isWindow ? window.pageYOffset : this.el.scrollTop; | ||
return this.isWindow ? window.scrollY : this.el.scrollTop; | ||
} | ||
@@ -375,3 +376,3 @@ }, { | ||
value: function getX() { | ||
return this.isWindow ? window.pageXOffset : this.el.scrollLeft; | ||
return this.isWindow ? window.scrollX : this.el.scrollLeft; | ||
} | ||
@@ -568,2 +569,4 @@ }, { | ||
updateDirection(dir1, ''); | ||
updateDirection(x1, Math.round(window.detectScroll.x)); | ||
updateDirection(y1, Math.round(window.detectScroll.y)); | ||
}, | ||
@@ -783,3 +786,3 @@ scrollUp: function scrollUp(ev) { | ||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws'; | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "62694" + '/'); | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "58157" + '/'); | ||
@@ -786,0 +789,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 + ':' + "62694" + '/'); | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "58157" + '/'); | ||
@@ -223,0 +223,0 @@ ws.onmessage = function (event) { |
@@ -35,2 +35,4 @@ import DetectScroll from '../index.js' | ||
updateDirection(dir1, '') | ||
updateDirection(x1, Math.round(window.detectScroll.x)) | ||
updateDirection(y1, Math.round(window.detectScroll.y)) | ||
}, | ||
@@ -37,0 +39,0 @@ scrollUp: (ev) => { |
@@ -100,3 +100,3 @@ import { getEl } from './src/getElement' | ||
getY() { | ||
return this.isWindow ? window.pageYOffset : this.el.scrollTop | ||
return this.isWindow ? window.scrollY : this.el.scrollTop | ||
} | ||
@@ -135,3 +135,3 @@ | ||
getX() { | ||
return this.isWindow ? window.pageXOffset : this.el.scrollLeft | ||
return this.isWindow ? window.scrollX : this.el.scrollLeft | ||
} | ||
@@ -138,0 +138,0 @@ |
{ | ||
"name": "@egstad/detect-scroll", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"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", |
@@ -24,3 +24,4 @@ const eventsDefault = ['scrollStart', 'scrollStop'] | ||
else if (eventOverrides && !typeOf(eventOverrides)) { | ||
console.error(`Whoops! 'events' must be an object with at least one prop.`) | ||
// console.error(`Whoops! 'events' must be an object with at least one prop.`) | ||
return | ||
} | ||
@@ -27,0 +28,0 @@ // defaults |
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
Sorry, the diff of this file is not supported yet
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
2469119
84
3057
14
17