@wildebeest/drag
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@wildebeest/drag", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Draging event module", | ||
@@ -8,3 +8,4 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"build": "tsc --declaration" | ||
"build": "tsc --declaration", | ||
"test": "jest" | ||
}, | ||
@@ -16,5 +17,9 @@ "repository": { | ||
"dependencies": { | ||
"@wildebeest/common": "^0.1.0" | ||
"@wildebeest/js-modules": "^0.1.0", | ||
"@wildebeest/common": "^0.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.11", | ||
"jest": "^24.7.1", | ||
"ts-jest": "^24.0.2", | ||
"typescript": "^3.4.3" | ||
@@ -21,0 +26,0 @@ }, |
@@ -5,7 +5,7 @@ import { Emitter } from "@wildebeest/common"; | ||
{ | ||
protected element: any; | ||
protected element: HTMLElement; | ||
protected emitter: Emitter; | ||
protected mousePosition: any; | ||
protected mousePosition: MouseEvent; | ||
constructor(element: any, emitter: Emitter) | ||
constructor(element: HTMLElement, emitter: Emitter) | ||
{ | ||
@@ -15,3 +15,3 @@ this.element = element; | ||
this.element.addEventListener('mousedown', (event: any) => { | ||
this.element.addEventListener('mousedown', (event: MouseEvent) => { | ||
if (event.button != 0) { | ||
@@ -25,3 +25,3 @@ return; | ||
window.addEventListener('mouseup', (event: any) => { | ||
window.addEventListener('mouseup', (event: MouseEvent) => { | ||
if (event.button != 0 || !this.mousePosition) { | ||
@@ -35,3 +35,3 @@ return; | ||
protected onMove(event: any): void | ||
protected onMove(event: MouseEvent): void | ||
{ | ||
@@ -43,4 +43,4 @@ if (!this.mousePosition) { | ||
let diff: any = { | ||
'vertical': event.y - this.mousePosition.y, | ||
'horizontal': event.x - this.mousePosition.x | ||
vertical: event.clientY - this.mousePosition.clientY, | ||
horizontal: event.clientX - this.mousePosition.clientX | ||
}; | ||
@@ -47,0 +47,0 @@ this.mousePosition = event; |
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
11424
18
223
2
4
+ Added@wildebeest/common@0.2.5(transitive)
- Removed@wildebeest/common@0.1.1(transitive)
Updated@wildebeest/common@^0.2.0