Socket
Socket
Sign inDemoInstall

tap-listener

Package Overview
Dependencies
2
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 2.0.0

3

bower.json
{
"name": "tap-listener",
"main": "tap-listener.js",
"version": "1.1.2",
"dependencies": {
"unipointer": "~1.1.0"
"unipointer": "^2.1.0"
},

@@ -8,0 +7,0 @@ "authors": [

{
"name": "tap-listener",
"version": "1.1.2",
"version": "2.0.0",
"description": "Listens to taps",
"main": "tap-listener.js",
"dependencies": {
"unipointer": "~1.1.0"
"unipointer": "^2.1.0"
},

@@ -9,0 +9,0 @@ "devDependencies": {},

/*!
* Tap listener v1.1.2
* Tap listener v2.0.0
* listens to taps

@@ -20,3 +20,3 @@ * MIT license

});
} else if ( typeof exports == 'object' ) {
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS

@@ -46,3 +46,3 @@ module.exports = factory(

// inherit Unipointer & EventEmitter
TapListener.prototype = new Unipointer();
var proto = TapListener.prototype = Object.create( Unipointer.prototype );

@@ -53,3 +53,3 @@ /**

*/
TapListener.prototype.bindTap = function( elem ) {
proto.bindTap = function( elem ) {
if ( !elem ) {

@@ -63,3 +63,3 @@ return;

TapListener.prototype.unbindTap = function() {
proto.unbindTap = function() {
if ( !this.tapElement ) {

@@ -72,3 +72,2 @@ return;

var isPageOffset = window.pageYOffset !== undefined;
/**

@@ -79,3 +78,3 @@ * pointer up

*/
TapListener.prototype.pointerUp = function( event, pointer ) {
proto.pointerUp = function( event, pointer ) {
// ignore emulated mouse up clicks

@@ -88,5 +87,4 @@ if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) {

var boundingRect = this.tapElement.getBoundingClientRect();
// standard or IE8 scroll positions
var scrollX = isPageOffset ? window.pageXOffset : document.body.scrollLeft;
var scrollY = isPageOffset ? window.pageYOffset : document.body.scrollTop;
var scrollX = window.pageXOffset;
var scrollY = window.pageYOffset;
// calculate if pointer is inside tapElement

@@ -106,9 +104,10 @@ var isInside = pointerPoint.x >= boundingRect.left + scrollX &&

// reset flag after 300ms
var _this = this;
setTimeout( function() {
delete this.isIgnoringMouseUp;
}.bind( this ), 320 );
delete _this.isIgnoringMouseUp;
}, 400 );
}
};
TapListener.prototype.destroy = function() {
proto.destroy = function() {
this.pointerDone();

@@ -115,0 +114,0 @@ this.unbindTap();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc