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

angular-long-press

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-long-press

An angular.js long press directive for both desktop and mobile

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

angular-long-press

Long press support for both desktop and mobile when used in AngularJS framework

Thank you GitHub Gist , grrrian for Prevent long press while scrolling

Demo and Project page

Dependencies

This repository contains native AngularJS directives . The only required dependencies are:

  • AngularJS (tested with 1.4.9 although it probably works with older versions)

Installation

bower install angular-long-press --save

Alternatively files can be downloaded downloaded from Github. and copy the files from dist/. Then add the sources to your code (adjust paths as needed) after adding the dependencies for Angular first:

<script src="./bower_components/angular/angular.min.js"></script>
<script src="./bower_components/angular-long-press/dist/angular-long-press.js"></script>

Whichever method you choose the good news is that the overall size is very small: < 2.5kb for all directives (~0.5kb with gzip compression!)

As soon as you've got all the files downloaded and included in your page you just need to declare a dependency on the pr.longpress module:

angular.module('myModule', ['pr.longpress']);

Example

Markup

<button on-long-press="onLongPress()" on-touch-end="onTouchEnd()" prevent-click="true"></button>

Options

There are several options that you can set as attributes on the directive element

  1. on-long-press : method to be called when long press event is triggered
  2. on-touch-end : method to be called when touch end or mouse up event is triggered
  3. prevent-click : default true, to prevent click event getting triggered after long press is triggered
  4. long-press-duration : default 600, Integer value in MS to indicate after how long user touches will trigger long-press event
  5. prevent-onscrolling : default true, Boolean value to prevent long press when user is scrolling.

Issues

Please check if issue exists and otherwise open issue in github

Please add a link to a plunker, jsbin, or equivalent.

License

angular-long-press.js is available under the MIT license.

Bitdeli Badge

Keywords

FAQs

Package last updated on 26 Feb 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc