New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-file-drop-zone

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-file-drop-zone

easily add a dropzone to enable file drag and drop to your ember app

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ember-file-drop-zone

Greenkeeper badge Latest NPM release TravisCI Build Status Coverage Status Code Climate Ember Observer Score Dependencies Dev Dependencies

easily add a dropzone to enable file drag and drop to your ember app

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above

Installation

ember install ember-file-drop-zone

Demo

check out the demo page

Usage

Ember file drop-zone provides both a mixin to add to existing components and a simple component that can be used in block form.

See the source code of the demo app for more complex examples

Component

{{#file-drop-zone onDrop=(action "addFiles")}}
  just drop your files here...
{{/file-drop-zone}}

Mixin

import Component from '@ember/component';
import DropZone from 'ember-file-drop-zone/mixins/file-drop-zone';

export default Component.extend(DropZone, {

});

Parameters

Paramtertypedefaultdescription
disabledbooleanfalsewhen set to true, the dropzone is disabled and files can no longer be dropped

Events

onDrop(files)

called when files have been dropped

files an EmberArray of js file objects that were dropped

onDragEnter()

called when files are being dragged over the dropzone

onDragLeave()

called when files are no longer dragged over the dropzone

Styling

This addon does not provide any predefined styles. However, it applies appropriate css class names so that look can be modified as needed.

classdescription
ember-file-drop-zoneUsed to style the default state of the dropzone
disabledApplied when the dropzone is disabled
draggingApplied when one or more files are current being dragged over the dropzone

Please see app.css for a styling example:

.ember-file-drop-zone {
  // initial styles
}

.ember-file-drop-zone.disabled {
  // styles when disabled
}

.ember-file-drop-zone.dragging:not(.disabled) {
  // styles when files are being dragged over the window, but not over the dropzone and dropzone is not disabled
}

.ember-file-drop-zone.hovering {
  // styles when files are being dragged over the dropzone (independent of the disabled state)
}

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 26 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc