Closed seanCodes closed 7 years ago
Looks alright to me, @briangonzalez you cool with me merging this?
@briangonzalez Bump
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.
@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.
@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.
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 whetherdx
ordy
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.