Coder Social home page Coder Social logo

angular-long-press's People

Contributors

bitdeli-chef avatar puneethrai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

angular-long-press's Issues

We should disable long press while scrolling

To address this we can add the following:

                    // ...
                    var touchStartY;
                    var touchStartX;
                    var MAX_DELTA = 15;

                    // ...

                    $elm.bind('touchmove', onMove);

                    // in onEnter(), add:
                    touchStartY = _.get(evt, 'touches[0].screenY');
                    touchStartX = _.get(evt, 'touches[0].screenX');

                    // ...

                    function onMove(evt) {
                        var yPosition = _.get(evt, 'touches[0].screenY');
                        var xPosition = _.get(evt, 'touches[0].screenX');

                        // If we scrolled, prevent long presses
                        if (!_.isUndefined(touchStartY) && !_.isUndefined(touchStartX) &&
                            (Math.abs(yPosition - touchStartY) > MAX_DELTA) || Math.abs(xPosition - touchStartX) > MAX_DELTA) {
                            $timeout.cancel(timer);
                        }

                    }

The 15px delta is to help with "fat fingers". Very slight scrolling is probably unintentional.

Add version tag

Hi,
Would you mind tagging the current release with a version, to allow cleaner integration with bower?

Thanks

Unknown provider?

I'm trying to use this directive inside of my Cordova Angular app, but it's failing and I'm not sure why. Angular error says:

Unknown provider: nProvider <- n <- onLongPressDirective

I have verified:

  • The source js is loaded
  • My app has the 'pr.longpress' module inserted, not seeing any errors there
  • The directive code should be ok:
    <button on-long-press="vm.toggle(log)">test</button>

But still the above error. What am I missing here?

Configurable long press timeout duration

Change the current default value of 600 to a configurable value

Option Name:
long-press-duration: Integer value in MS to indicate after how long user touches will trigger long-press event
default: 600

Misalignment with Angular Material mdMenu

When used with Angular Material Menu directive it causes the menu-content alignment to fail.
I think it's something related with event and I'm trying to investigate further.

Here is a pen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.