draggable-mixin

1.0.1 • Public • Published

draggable-mixin

This is a simple wrapper of the Hammer.js lib on your ember component.

Installation

ember install draggable-mixin

Usage

Just include this mixin to your component:

import DraggableMixin from 'draggable-mixin/mixins/draggable';

export default Component.extend(DraggableMixin, {});

panDirection - function to restrict directions. Should return directional constant. Directional constants are similar to Hammer's. maxDistance - numeric attribute that restricts drag distance. onPanEnvComplete - function evaluated on panstop. targetElement - DOM element to apply wrapper

There are also _beforeMove and _afterMove hooks to provide additional control over process.

Contributing

Installation

  • git clone <repository-url>
  • cd draggable-mixin
  • npm install

Linting

  • npm run lint:hbs
  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i draggable-mixin

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

9.39 kB

Total Files

8

Last publish

Collaborators

  • ollar