Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Apr 25, 2017

Conversation

seanCodes
Copy link
Collaborator

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.

When the `axis` option is set to “auto”, dragging will be constrained
along the x *or* the y axis, depending on the dominant direction of the
drag. This allows pep objects to be dragged either just vertically or
just horizontally, but not both at the same time.
@Anaphase
Copy link
Collaborator

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

@seanCodes
Copy link
Collaborator Author

@briangonzalez Bump

@Anaphase
Copy link
Collaborator

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.

package.json Outdated
@@ -2,7 +2,7 @@
"name": "pep",
"title": "jquery.pep.js",
"description": "Kinetic drag for mobile & desktop",
"version": "0.6.8",
"version": "0.6.9",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this line since I cannot publish a new NPM version after merging this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 👍

@briangonzalez
Copy link
Owner

@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
Copy link
Owner

@Anaphase @seanCodes

I am working on making the repo NPM ready on this PR: #197

I've asked you both a question over there.

@Anaphase Anaphase merged commit 629be34 into briangonzalez:master Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants