Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dom-autoscroller

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-autoscroller - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

65

dist/dom-autoscroller.js

@@ -1,6 +0,63 @@

var autoScroll = (function (createPointCB) {
var autoScroll = (function () {
'use strict';
createPointCB = 'default' in createPointCB ? createPointCB['default'] : createPointCB;
var index = function createPointCB(object) {
// A persistent object (as opposed to returned object) is used to save memory
// This is good to prevent layout thrashing, or for games, and such
// NOTE
// This uses IE fixes which should be OK to remove some day. :)
// Some speed will be gained by removal of these.
// pointCB should be saved in a variable on return
// This allows the usage of element.removeEventListener
return function pointCB(event) {
event = event || window.event; // IE-ism
object.target = event.target || event.srcElement || event.originalTarget;
object.element = this;
object.type = event.type;
// Support touch
// http://www.creativebloq.com/javascript/make-your-site-work-touch-devices-51411644
if (event.targetTouches) {
object.x = event.targetTouches[0].clientX;
object.y = event.targetTouches[0].clientY;
object.pageX = event.pageX;
object.pageY = event.pageY;
} else {
// If pageX/Y aren't available and clientX/Y are,
// calculate pageX/Y - logic taken from jQuery.
// (This is to support old IE)
// NOTE Hopefully this can be removed soon.
if (event.pageX === null && event.clientX !== null) {
var eventDoc = event.target && event.target.ownerDocument || document;
var doc = eventDoc.documentElement;
var body = eventDoc.body;
object.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
object.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
} else {
object.pageX = event.pageX;
object.pageY = event.pageY;
}
// pageX, and pageY change with page scroll
// so we're not going to use those for x, and y.
// NOTE Most browsers also alias clientX/Y with x/y
// so that's something to consider down the road.
object.x = event.clientX;
object.y = event.clientY;
}
};
//NOTE Remember accessibility, Aria roles, and labels.
};
var requestFrame = function () {

@@ -35,3 +92,3 @@ if (requestAnimationFrame) {

var point = {},
pointCB = createPointCB(point),
pointCB = index(point),
down = false;

@@ -326,3 +383,3 @@

}(createPointCB));
}());
//# sourceMappingURL=dom-autoscroller.js.map

2

package.json
{
"name": "dom-autoscroller",
"version": "2.0.0",
"version": "2.1.0",
"description": "Auto scroll dom elements",

@@ -5,0 +5,0 @@ "main": "dist/bundle.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc