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

dom-lib

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-lib - npm Package Compare versions

Comparing version 1.0.0-beta to 1.0.0-beta.1

16

lib/DOMMouseMoveTracker.js

@@ -34,3 +34,3 @@ 'use strict';

this.isDragging = false;
this.isDraggingStatus = false;
this.animationFrameID = null;

@@ -46,3 +46,3 @@ this.eventMoveToken = null;

this.isDragging = function () {
return _this.isDragging;
return _this.isDraggingStatus;
};

@@ -65,2 +65,3 @@

_this.y = y;
_this.moveEvent = event;

@@ -73,2 +74,3 @@ event.preventDefault();

_this.onMove(_this.deltaX, _this.deltaY, _this.moveEvent);
_this.deltaX = 0;

@@ -99,3 +101,3 @@ _this.deltaY = 0;

DOMMouseMoveTracker.prototype.captureMouseMoves = function captureMouseMoves(event) {
if (!this.eventMoveToken && !this.eventUpToken && this.domNode) {
if (!this.eventMoveToken && !this.eventUpToken) {
this.eventMoveToken = (0, _on2.default)(this.domNode, 'mousemove', this.onMouseMove);

@@ -105,6 +107,6 @@ this.eventUpToken = (0, _on2.default)(this.domNode, 'mouseup', this.onMouseUp);

if (!this.isDragging) {
if (!this.isDraggingStatus) {
this.deltaX = 0;
this.deltaY = 0;
this.isDragging = true;
this.isDraggingStatus = true;
this.x = event.clientX;

@@ -138,4 +140,4 @@ this.y = event.clientY;

if (this.isDragging) {
this.isDragging = false;
if (this.isDraggingStatus) {
this.isDraggingStatus = false;
this.x = 0;

@@ -142,0 +144,0 @@ this.y = 0;

{
"name": "dom-lib",
"version": "1.0.0-beta",
"version": "1.0.0-beta.1",
"description": "DOM helper library",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -8,3 +8,3 @@ // @flow

class DOMMouseMoveTracker {
isDragging = false;
isDraggingStatus = false;
animationFrameID = null;

@@ -39,3 +39,3 @@ domNode: HTMLElement;

captureMouseMoves(event: Object) {
if (!this.eventMoveToken && !this.eventUpToken && this.domNode) {
if (!this.eventMoveToken && !this.eventUpToken) {
this.eventMoveToken = on(this.domNode, 'mousemove', this.onMouseMove);

@@ -45,6 +45,6 @@ this.eventUpToken = on(this.domNode, 'mouseup', this.onMouseUp);

if (!this.isDragging) {
if (!this.isDraggingStatus) {
this.deltaX = 0;
this.deltaY = 0;
this.isDragging = true;
this.isDraggingStatus = true;
this.x = event.clientX;

@@ -76,4 +76,4 @@ this.y = event.clientY;

if (this.isDragging) {
this.isDragging = false;
if (this.isDraggingStatus) {
this.isDraggingStatus = false;
this.x = 0;

@@ -87,3 +87,3 @@ this.y = 0;

*/
isDragging = () => this.isDragging;
isDragging = () => this.isDraggingStatus;

@@ -94,4 +94,4 @@ /**

onMouseMove = (event: Object) => {
var x: number = event.clientX;
var y = event.clientY;
let x: number = event.clientX;
let y = event.clientY;

@@ -109,2 +109,3 @@ this.deltaX += x - this.x;

this.y = y;
this.moveEvent = event;

@@ -117,2 +118,3 @@ event.preventDefault();

this.onMove(this.deltaX, this.deltaY, this.moveEvent);
this.deltaX = 0;

@@ -119,0 +121,0 @@ this.deltaY = 0;

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