Socket
Socket
Sign inDemoInstall

unipointer

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    unipointer

Do one thing with one pointer


Version published
Weekly downloads
56K
decreased by-19.11%
Maintainers
1
Install size
93.1 kB
Created
Weekly downloads
 

Readme

Source

Unipointer

Base class for doing one thing with pointer event

Used with Unidragger and TapListener

Install

Bower: bower install unipointer

npm: npm install unipointer

Usage

// create new class
function PointerFun( elem ) {
  this.element = elem;
  // binds mousedown/touchstart/pointerdown event
  this._bindStartEvent( this.element, true );
}
// inherit Unipointer
PointerFun.prototype = new Unipointer();

// overwrite public pointer methods
PointerFun.prototype.pointerDown = function( event, pointer ) {
  console.log('pointer down');
};

PointerFun.prototype.pointerMove = function( event, pointer ) {
  console.log('pointer move');
};

PointerFun.prototype.pointerUp = function( event, pointer ) {
  console.log('pointer up');
};

PointerFun.prototype.pointerCancel = function( event, pointer ) {
  console.log('pointer cancel');
};

// triggered on pointerUp and pointerCancel 
PointerFun.prototype.pointerDone = function( event, pointer ) {
  console.log('pointer done');
};

MIT license

By Metafizzy

Keywords

FAQs

Last updated on 24 Jan 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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