1.3.6 • Published 4 years ago

ember-cli-dropzonejs v1.3.6

Weekly downloads
957
License
MIT
Repository
github
Last release
4 years ago

npm.io

Ember Observer Score Codeship Status for FutoRicky/ember-cli-dropzonejs

Drag and drop file uploader addon for ember-cli using Dropzonejs.

DEMO

Versions

Current version is running ember-cli >= 3.5.0

Versions 1.1.1 <= are running ember-cli 2.13.1

Versions 0.8.6 <= are running ember-cli 1.13.8

Installation

ember install ember-cli-dropzonejs

This addon will use dropzone's default css by default. If you prefer to use your own css, add this option to your ember-cli-build.js:

var app = new EmberApp(defaults, {
  ---
  emberCliDropzonejs: {
    includeDropzoneCss: false
  }
  ---
});

Usage

Simply add the component to your template like so: {{drop-zone url='/endpoint'}}

You can see all properties in the Dropzonejs configuration docs.

To set properties simply add the name of the property inside the component call and assign a value.

example:

{{drop-zone url='http://example.com/example' clickable=false addRemoveLinks=true}}

You can also use dynamic options:

// controller.js

import Controller from '@ember/controller';
import { computed } from '@ember/object';

export default Controller.extend({
  addedfile: computed(function() {
    return function() {
      Ember.Logger.debug('addedFile happened');
    };
  }),
  options: computed(function() {
    return {
      url: '#',
      addRemoveLinks: true,
      autoProcessQueue: false,
      addedfile: this.addedfile
    };
  })
});
// template.js

{{drop-zone config=options}}

If you would like to use the whole document body as a drop location you can set maxDropRegion to true

Event Handling

Dropzonejs Events Docs

To use events, set your event handler in your controller like so:

  addedFileEvent: computed(function() {
    return function() {
      // do something...
    };
  }),

and set it in your component declaration:

{{drop-zone url="http://example.com/example" addedfile=addedFileEvent}}

Remember to add an url, this addon will not work without it

Contributions

All contributions are welcomed and encouraged.

Please make all pull requests to the dev branch.

Thanks!

1.3.6

4 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.6

8 years ago

0.8.5

8 years ago

0.8.4

8 years ago

0.8.3

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.0

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago