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 1.0.9 to 1.0.10

25

lib/click.js

@@ -95,6 +95,14 @@ "use strict";

get: function get(e) {
var localName = e.target.localName;
var type = e.type;
var key = e.target.id + '_id';
if (this.db[key]) {
this.db[key](e);
if (localName !== 'button') {
this.db[key](e);
} else {
var device = this.detect();
if (device === 'mobile' && type === 'touchend') this.db[key](e);else if (device !== 'mobile' && type === 'mouseup') this.db[key](e);
}
return;

@@ -106,3 +114,10 @@ }

if (this.db[key]) {
this.db[key](e);
if (localName !== 'button') {
this.db[key](e);
} else {
var _device = this.detect();
if (_device === 'mobile' && type === 'touchend') this.db[key](e);else if (_device !== 'mobile' && type === 'mouseup') this.db[key](e);
}
return;

@@ -149,3 +164,9 @@ }

}
},
detect: function detect() {
var MobileDetect = require('mobile-detect'),
m = new MobileDetect(window.navigator.userAgent);
if (m.tablet()) return 'mobile';else if (m.mobile()) return 'mobile';else return 'desktop';
}
};

5

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

@@ -50,3 +50,6 @@ "main": "lib/index.js",

"url": "git@github.com:jameshsu1125/lesca-touch-event.git"
},
"dependencies": {
"mobile-detect": "^1.4.5"
}
}

@@ -15,3 +15,3 @@ import React from 'react';

<>
<div className='myDiv'>button</div>
<button className='myDiv'>button</button>
</>

@@ -18,0 +18,0 @@ );

@@ -78,10 +78,26 @@ module.exports = {

get(e) {
const { localName } = e.target;
const { type } = e;
let key = e.target.id + '_id';
if (this.db[key]) {
this.db[key](e);
if (localName !== 'button') {
this.db[key](e);
} else {
const device = this.detect();
if (device === 'mobile' && type === 'touchend') this.db[key](e);
else if (device !== 'mobile' && type === 'mouseup') this.db[key](e);
}
return;
}
key = e.target.className + '_class';
if (this.db[key]) {
this.db[key](e);
if (localName !== 'button') {
this.db[key](e);
} else {
const device = this.detect();
if (device === 'mobile' && type === 'touchend') this.db[key](e);
else if (device !== 'mobile' && type === 'mouseup') this.db[key](e);
}
return;

@@ -125,2 +141,10 @@ }

},
detect() {
let MobileDetect = require('mobile-detect'),
m = new MobileDetect(window.navigator.userAgent);
if (m.tablet()) return 'mobile';
else if (m.mobile()) return 'mobile';
else return 'desktop';
},
};
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