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

Per-action settings #115

Merged
merged 20 commits into from
Dec 7, 2014
Merged

Per-action settings #115

merged 20 commits into from
Dec 7, 2014

Conversation

taye
Copy link
Owner

@taye taye commented Nov 30, 2014

Interactable#<actionable>({ <setting>: { ... } })

For example:

interact(target)
.draggable({
  restrict: {
    restriction: 'parent',
    elementRect: { top: 0, left: 0, bottom: 1, right: 1 },
    endOnly: true
  },
   snap: {
    enabled: true,
    mode: 'grid',
    grid: { x: 10, y: 10, range: 50 }
  }
}).resizable({
  restrict: {
    restriction: 'parent',
    elementRect: { top: 1, left: 1, bottom: 1, right: 1 }
  },
  snap: { enabled: false }
})

Backwards compatibility with the old Interactable#<setting>({ ... }) is roughly maintained.

interact#<setting>(...) has been removed.

Closes #87

 - Action settings are each in separate objects
 - Option methods always either return the related object or the
   Interactable (never false).
 - Option parameters are expected to be correct. Less type checking is
   done.
@taye taye mentioned this pull request Nov 30, 2014
@taye taye merged commit d96b975 into master Dec 7, 2014
@taye taye deleted the per-action-settings branch December 31, 2014 19:57
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.

Settings like snap, inertia, etc. should be per-action
1 participant