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

ractive-events-tap

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ractive-events-tap - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

.babelrc

7

CHANGELOG.md
# changelog
## 0.3.0
* Create separate ES6/UMD builds
* Tidy up repo
## 0.2.0

@@ -7,2 +12,2 @@

* Rebuilt in ES6
* Started maintaining a changelog
* Started maintaining a changelog

24

package.json
{
"name": "ractive-events-tap",
"version": "0.2.0",
"version": "0.3.0",
"author": "Rich Harris",
"license": "MIT",
"repository": "https://github.com/ractivejs/ractive-events-tap",
"main": "dist/ractive-events-tap.js",
"jsnext:main": "src/ractive-events-tap.js",
"main": "dist/ractive-events-tap.umd.js",
"jsnext:main": "dist/ractive-events-tap.es6.js",
"description": "Tap/fastclick event plugin for Ractive.js",
"devDependencies": {
"gobble": "^0.7.2",
"gobble-babel": "^4.0.1",
"gobble-cli": "^0.3.5",
"gobble-esperanto-bundle": "^0.1.7"
"babel-preset-es2015-rollup": "^1.0.0",
"chai": "^3.4.1",
"eslint": "^1.10.2",
"mocha": "^2.3.4",
"ractive": "^0.7.3",
"rollup": "^0.21.1",
"rollup-plugin-babel": "^2.2.0",
"simulant": "^0.1.5"
},
"scripts": {
"build": "rm -rf dist; gobble build dist",
"prepublish": "npm run build"
"build": "rm -rf dist && rollup -c -f umd -o dist/ractive-events-tap.umd.js && rollup -c -f es6 -o dist/ractive-events-tap.es6.js",
"prepublish": "npm run build",
"lint": "eslint src",
"test": "open test/index.html"
}
}

@@ -34,3 +34,3 @@ # ractive-events-tap

**Note: previous versions of this plugin would 'self-register'. If you are using a module system such as Browserify, Webpack or RequireJS, that's no longer the case - you must explicitly register the plugin.
**Note: previous versions of this plugin would 'self-register'. If you are using a module system such as Browserify, Webpack or RequireJS, that's no longer the case - you must explicitly register the plugin.**

@@ -101,2 +101,2 @@

MIT
MIT

@@ -8,3 +8,3 @@ const DISTANCE_THRESHOLD = 5; // maximum pixels pointer can move before cancel

var TapHandler = function ( node, callback ) {
function TapHandler ( node, callback ) {
this.node = node;

@@ -16,3 +16,3 @@ this.callback = callback;

this.bind( node );
};
}

@@ -60,9 +60,9 @@ TapHandler.prototype = {

var x = event.clientX;
var y = event.clientY;
const x = event.clientX;
const y = event.clientY;
// This will be null for mouse events.
var pointerId = event.pointerId;
const pointerId = event.pointerId;
var handleMouseup = event => {
const handleMouseup = event => {
if ( event.pointerId != pointerId ) {

@@ -76,3 +76,3 @@ return;

var handleMousemove = event => {
const handleMousemove = event => {
if ( event.pointerId != pointerId ) {

@@ -87,3 +87,3 @@ return;

var cancel = () => {
const cancel = () => {
this.node.removeEventListener( 'MSPointerUp', handleMouseup, false );

@@ -116,11 +116,11 @@ document.removeEventListener( 'MSPointerMove', handleMousemove, false );

touchdown () {
var touch = event.touches[0];
const touch = event.touches[0];
var x = touch.clientX;
var y = touch.clientY;
const x = touch.clientX;
const y = touch.clientY;
var finger = touch.identifier;
const finger = touch.identifier;
var handleTouchup = event => {
var touch = event.changedTouches[0];
const handleTouchup = event => {
const touch = event.changedTouches[0];

@@ -146,5 +146,3 @@ if ( touch.identifier !== finger ) {

var handleTouchmove = event => {
var touch;
const handleTouchmove = event => {
if ( event.touches.length !== 1 || event.touches[0].identifier !== finger ) {

@@ -154,3 +152,3 @@ cancel();

touch = event.touches[0];
const touch = event.touches[0];
if ( ( Math.abs( touch.clientX - x ) >= DISTANCE_THRESHOLD ) || ( Math.abs( touch.clientY - y ) >= DISTANCE_THRESHOLD ) ) {

@@ -161,3 +159,3 @@ cancel();

var cancel = () => {
const cancel = () => {
this.node.removeEventListener( 'touchend', handleTouchup, false );

@@ -176,3 +174,3 @@ window.removeEventListener( 'touchmove', handleTouchmove, false );

teardown () {
var node = this.node;
const node = this.node;

@@ -209,2 +207,2 @@ node.removeEventListener( 'pointerdown', handleMousedown, false );

}
}
}
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