@egstad/detect-scroll
Advanced tools
Comparing version 1.0.9 to 1.0.10
{"total": {"lines":{"total":24,"covered":24,"skipped":0,"pct":100},"statements":{"total":24,"covered":24,"skipped":0,"pct":100},"functions":{"total":8,"covered":8,"skipped":0,"pct":100},"branches":{"total":32,"covered":27,"skipped":0,"pct":84.38}} | ||
,"/mnt/c/Users/egstad/Documents/Development/_construct-npm-packages/detect-scroll/src/events.js": {"lines":{"total":17,"covered":17,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":17,"covered":17,"skipped":0,"pct":100},"branches":{"total":19,"covered":16,"skipped":0,"pct":84.21}} | ||
,"/mnt/c/Users/egstad/Documents/Development/_construct-npm-packages/detect-scroll/src/getElement.js": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":13,"covered":11,"skipped":0,"pct":84.62}} | ||
,"/Users/egstad/Sites/construct/detect-scroll/src/events.js": {"lines":{"total":17,"covered":17,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":17,"covered":17,"skipped":0,"pct":100},"branches":{"total":19,"covered":16,"skipped":0,"pct":84.21}} | ||
,"/Users/egstad/Sites/construct/detect-scroll/src/getElement.js": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":13,"covered":11,"skipped":0,"pct":84.62}} | ||
} |
@@ -162,3 +162,3 @@ // modules are defined as an array | ||
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
@@ -189,7 +189,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
else if (eventOverrides && !typeOf(eventOverrides)) { | ||
console.error("Whoops! 'events' must be an object with at least one prop."); | ||
} // defaults | ||
else { | ||
return [].concat(eventsDefault, _toConsumableArray(isVertical ? eventsVertical : []), _toConsumableArray(isHorizontal ? eventsHorizontal : [])); | ||
} | ||
console.error("Whoops! 'events' must be an object with at least one prop."); | ||
} // defaults | ||
else { | ||
return [].concat(eventsDefault, _toConsumableArray(isVertical ? eventsVertical : []), _toConsumableArray(isHorizontal ? eventsHorizontal : [])); | ||
} | ||
} | ||
@@ -479,3 +479,8 @@ | ||
if (unthrottledEvents.includes(type)) { | ||
this.el.dispatchEvent(new CustomEvent(type)); | ||
this.el.dispatchEvent(new CustomEvent(type, { | ||
detail: { | ||
x: this.x, | ||
y: this.y | ||
} | ||
})); | ||
if (this.debugMode) console.info(type); | ||
@@ -583,3 +588,4 @@ } | ||
poster.style.backgroundImage = "conic-gradient(from ".concat(y * 0.05, "deg, #101115, #298DD9, #DEE4CA, #F7BF46, #EF1A03)"); | ||
hori.scrollTo(y, 0); // console.log(instanceWindow.y) | ||
hori.scrollTo(y, 0); | ||
console.log(ev); // console.log(instanceWindow.y) | ||
} // scrollMaxY: () => {}, | ||
@@ -777,3 +783,3 @@ // scrollMinX: () => {}, | ||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws'; | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60197" + '/'); | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "62694" + '/'); | ||
@@ -780,0 +786,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 + ':' + "60197" + '/'); | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "62694" + '/'); | ||
@@ -223,0 +223,0 @@ ws.onmessage = function (event) { |
@@ -61,2 +61,3 @@ import DetectScroll from '../index.js' | ||
hori.scrollTo(y, 0) | ||
console.log(ev) | ||
// console.log(instanceWindow.y) | ||
@@ -63,0 +64,0 @@ }, |
@@ -250,3 +250,10 @@ import { getEl } from './src/getElement' | ||
if (unthrottledEvents.includes(type)) { | ||
this.el.dispatchEvent(new CustomEvent(type)) | ||
this.el.dispatchEvent( | ||
new CustomEvent(type, { | ||
detail: { | ||
x: this.x, | ||
y: this.y, | ||
}, | ||
}) | ||
) | ||
@@ -253,0 +260,0 @@ if (this.debugMode) console.info(type) |
{ | ||
"name": "@egstad/detect-scroll", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "A performant and lightweight ES6 module for detecting scroll activity (direction + location) for X and/or Y axis", | ||
@@ -38,4 +38,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.14.3", | ||
"eslint": "^7.13.0", | ||
"@babel/core": "^7.14.8", | ||
"eslint": "^7.31.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
@@ -45,7 +45,7 @@ "eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"jest": "^27.0.4", | ||
"jest": "^27.0.6", | ||
"jest-coverage-badges": "^1.1.2", | ||
"parcel-bundler": "^1.12.5", | ||
"prettier": "^2.3.0", | ||
"sass": "^1.34.1" | ||
"prettier": "^2.3.2", | ||
"sass": "^1.35.2" | ||
}, | ||
@@ -52,0 +52,0 @@ "jest": { |
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
2406901
82
3004
13
16