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

lesca-click

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

lesca-click - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

30

lib/click.js

@@ -21,3 +21,11 @@ "use strict";

this.ex_up = ex_up;
this.is_press = false; // if (this.detect() === 'desktop') this.deviation = 0;
this.is_press = false;
this.pageOffset = {
top: 0,
left: 0
};
this.pageOffseta = {
top: 0,
left: 0
};

@@ -38,4 +46,7 @@ this.down = function (e) {

}
}
} // check element position
_this.pageOffset = _this.pageOffseta = _this.getOffset(e);
_this.ex_down(e);

@@ -65,2 +76,4 @@

_this.pageOffseta = _this.getOffset(e);
_this.ex_move(e);

@@ -70,4 +83,6 @@ };

this.up = function (e) {
if (Math.abs(_this.px - _this.mx) <= _this.deviation && Math.abs(_this.py - _this.my) <= _this.deviation) {
_this.get(e);
if (_this.pageOffset.top === _this.pageOffseta.top && _this.pageOffset.left === _this.pageOffseta.left) {
if (Math.abs(_this.px - _this.mx) <= _this.deviation && Math.abs(_this.py - _this.my) <= _this.deviation) {
_this.get(e);
}
}

@@ -172,3 +187,10 @@

if (m.tablet()) return 'mobile';else if (m.mobile()) return 'mobile';else return 'desktop';
},
getOffset: function getOffset(e) {
var rect = e === null || e === void 0 ? void 0 : e.target.getBoundingClientRect();
return {
top: rect.top + window.scrollY,
left: rect.left + window.scrollX
};
}
};

2

package.json
{
"name": "lesca-click",
"version": "2.0.1",
"version": "2.1.0",
"description": "replace click / touch start on SPY page",

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

@@ -14,3 +14,4 @@ module.exports = {

// if (this.detect() === 'desktop') this.deviation = 0;
this.pageOffset = { top: 0, left: 0 };
this.pageOffseta = { top: 0, left: 0 };

@@ -30,2 +31,6 @@ this.down = (e) => {

}
// check element position
this.pageOffset = this.pageOffseta = this.getOffset(e);
this.ex_down(e);

@@ -53,2 +58,3 @@ this.is_press = true;

}
this.pageOffseta = this.getOffset(e);
this.ex_move(e);

@@ -58,4 +64,6 @@ };

this.up = (e) => {
if (Math.abs(this.px - this.mx) <= this.deviation && Math.abs(this.py - this.my) <= this.deviation) {
this.get(e);
if (this.pageOffset.top === this.pageOffseta.top && this.pageOffset.left === this.pageOffseta.left) {
if (Math.abs(this.px - this.mx) <= this.deviation && Math.abs(this.py - this.my) <= this.deviation) {
this.get(e);
}
}

@@ -155,2 +163,9 @@ this.is_press = false;

},
getOffset(e) {
const rect = e?.target.getBoundingClientRect();
return {
top: rect.top + window.scrollY,
left: rect.left + window.scrollX,
};
},
};
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