/ember-drag-drop-polyfill

Brings drag-drop-polyfill into your Ember applications.

Primary LanguageJavaScriptMIT LicenseMIT

ember-drag-drop-polyfill

Build Status npm version

This addon brings mobile-drag-drop into your Ember applications to polyfill drag and drop events for mobile browsers.

Compatibility

  • Ember.js v3.16 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-drag-drop-polyfill

For versions of Ember CLI < 2.15,

ember install ember-drag-drop-polyfill@0.1.0

Usage

Configure what files are included in your build by modifying ember-cli-build.js.

Example:

// ember-cli-build.js

var app = new EmberApp(defaults, {
  // Add options here

  "ember-drag-drop-polyfill": {
    includeCSS: true,
    includeIconsCss: false,
    includeDebugCss: true
  }
});

Pass configuration options through to mobile-drag-drop by modifying config/environment.js.

Example:

// config/environment.js 
var ENV = {

  // ...

  "ember-drag-drop-polyfill": {
    // These options are passed through to mobile-drag-drop
    mobileDragDrop: {
      enableEnterLeave: true,
      holdToDrag: 500, // Hold for 500ms until drag starts
    },
    // These options are used by ember-drag-drop-polyfill
    customOptions: {
      enableIOSHack: true, // Enable if targeting iOS Safari 10.x and higher, see https://github.com/timruffles/mobile-drag-drop/issues/77
      includeScrollBehavior: true // Sets the 'dragImageTranslateOverride' option in mobile-drag-drop
    }
  },
  
  // ...
};

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.