How to use the ember-file-upload/system/drag-listener function in ember-file-upload

To help you get started, we’ve selected a few ember-file-upload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mnutt / davros / app / components / davros-uploader / component.js View on Github external
import fileDropzone from 'ember-file-upload/components/file-dropzone/component';
import DragListener from 'ember-file-upload/system/drag-listener';
import Ember from 'ember';

const { get } = Ember;
const { bind } = Ember.run;

const dragListener = new DragListener();

export default fileDropzone.extend({
  didInsertElement() {
    this._super();

    if (get(this, 'fullscreen')) {
      dragListener.addEventListeners('body', {
        dragenter: bind(this, 'didEnterDropzone'),
        dragleave: bind(this, 'didLeaveDropzone'),
        dragover:  bind(this, 'didDragOver'),
        drop:      bind(this, 'didDrop')
      });
    }
  },

  willDestroyElement() {