tonic-mouse-handler
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -25,2 +25,9 @@ // Module dependencies and constants | ||
function getRelative(el, event) { | ||
return { | ||
x: event.center.x - (el.getClientRects()[0].x || el.getClientRects()[0].left), | ||
y: event.center.y - (el.getClientRects()[0].y || el.getClientRects()[0].top) | ||
}; | ||
} | ||
function broadcast(ctx, topic, event) { | ||
@@ -32,6 +39,3 @@ event.preventDefault(); | ||
event.modifier = ctx.modifier ? ctx.modifier : getModifier(event); | ||
event.relative = { | ||
x: event.center.x - (ctx.el.getClientRects()[0].x || ctx.el.getClientRects()[0].left), | ||
y: event.center.y - (ctx.el.getClientRects()[0].y || ctx.el.getClientRects()[0].top) | ||
} | ||
event.relative = getRelative(ctx.el, event); | ||
@@ -143,3 +147,5 @@ ctx.emit(topic, event); | ||
this.emit('modifier.change', { value: this.modifier, list: Modifier }); | ||
e.relative = getRelative(this.el, e); | ||
this.emit('modifier.change', { value: this.modifier, list: Modifier, event: e }); | ||
} | ||
@@ -146,0 +152,0 @@ }); |
{ | ||
"name": "tonic-mouse-handler", | ||
"description": "JavaScript library used to simplify mouse handling via a consistent API across modern browser.", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"license": "BSD-3-Clause", | ||
@@ -6,0 +6,0 @@ "main": "./lib/MouseHandler.js", |
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Obfuscated code
Supply chain riskObfuscated files are intentionally packed to hide their behavior. This could be a sign of malware.
Found 2 instances in 1 package
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
Found 1 instance in 1 package
2195502
31556
0
4
1