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

unipointer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unipointer - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

2

package.json
{
"name": "unipointer",
"version": "2.2.1",
"version": "2.3.0",
"description": "Do one thing with one pointer",

@@ -5,0 +5,0 @@ "main": "unipointer.js",

@@ -52,2 +52,2 @@ # Unipointer

By [Metafizzy](http://metafizzy.co)
By [Metafizzy](https://metafizzy.co)
/*!
* Unipointer v2.2.1
* Unipointer v2.3.0
* base class for doing one thing with pointer event

@@ -53,18 +53,20 @@ * MIT license

/**
* works as unbinder, as you can ._bindStart( false ) to unbind
* @param {Boolean} isBind - will unbind if falsey
* Add or remove start event
* @param {Boolean} isAdd - remove if falsey
*/
proto._bindStartEvent = function( elem, isBind ) {
// munge isBind, default to true
isBind = isBind === undefined ? true : !!isBind;
var bindMethod = isBind ? 'addEventListener' : 'removeEventListener';
proto._bindStartEvent = function( elem, isAdd ) {
// munge isAdd, default to true
isAdd = isAdd === undefined ? true : isAdd;
var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
// default to mouse events
var startEvent = 'mousedown';
if ( window.PointerEvent ) {
// Pointer Events. Chrome 55, IE11, Edge 14
elem[ bindMethod ]( 'pointerdown', this );
} else {
// listen for both, for devices like Chrome Pixel
elem[ bindMethod ]( 'mousedown', this );
elem[ bindMethod ]( 'touchstart', this );
// Pointer Events
startEvent = 'pointerdown';
} else if ( 'ontouchstart' in window ) {
// Touch Events. iOS Safari
startEvent = 'touchstart';
}
elem[ bindMethod ]( startEvent, this );
};

@@ -242,8 +244,11 @@

proto._pointerDone = function() {
this._pointerReset();
this._unbindPostStartEvents();
this.pointerDone();
};
proto._pointerReset = function() {
// reset properties
this.isPointerDown = false;
delete this.pointerIdentifier;
// remove events
this._unbindPostStartEvents();
this.pointerDone();
};

@@ -250,0 +255,0 @@

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