Comparing version 1.0.0-beta to 1.0.0-beta.1
@@ -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; |
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
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
102704