briangonzalez / jquery.pep.js

👟 Pep, a lightweight plugin for kinetic drag on mobile/desktop
http://pep.briangonzalez.org
1.3k stars 178 forks source link

Add "auto" as a value for the axis option #196

Closed seanCodes closed 7 years ago

seanCodes commented 7 years ago

This PR adds a new “auto” value for the axis option. When set to auto, dragging will be constrained along the x or the y axis, depending on the direction of the drag. This allows pep objects to be dragged either just vertically or just horizontally. The axis to use is determined on drag—based on whether dx or dy is greater—then cached until pep-stop, when it’s reset for the next drag.

I’m adding this as an option because I could find no other way to do this given the tools Pep currently provides (primarily because the drag callback is called after the object has already moved). It also seemed like it could be useful for other developers.

All unit tests passed (although I had to open the test page to check them since I was getting a Phantom error when running via grunt). I’ve also updated the axis demo to include an “auto” example.

Anaphase commented 7 years ago

Looks alright to me, @briangonzalez you cool with me merging this?

seanCodes commented 7 years ago

@briangonzalez Bump

Anaphase commented 7 years ago

I'm pretty sure @briangonzalez has abandoned this project. I can merge the PR because it looks fine to me, but I cannot publish new versions to NPM unless he adds me as a collaborator on NPM. Since that's the case, I'd rather not merge a PR that affects the package.json version number so if you change that I'll marge it.

briangonzalez commented 7 years ago

@Anaphase @seanCodes I haven't abandoned the project, more so just don't have a need for it in my current work.

I would love help keeping the repo up to date and I am 100% ok with you both merging and releasing to NPM at will, as long as we follow semver, etc.

We don't currently push this library to npm, but I am ok doing so. Let me set that up.

briangonzalez commented 7 years ago

@Anaphase @seanCodes

I am working on making the repo NPM ready on this PR: https://github.com/briangonzalez/jquery.pep.js/pull/197

I've asked you both a question over there.