Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ember-drop-zone
Advanced tools
Readme
Ember-drop-zone is an Ember-cli addon that provides a drop-zone component.
ember install ember-drop-zone
Create a drop-zone using the {{drop-zone}}
component.
{{#drop-zone action=(action "doSomething")}}
drop items here...
{{/drop-zone}}
Then handle the action in your controller or component.
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
doSomething(droppedItem) {
// do something with `droppedItem`
}
}
});
By default the DropZoneComponent
component will extract string data from the event.dataTransfer
object.
The DropZoneComponent
be setup to enable dropping files onto it. First, you need to import the getFiles
method into your controller or component.
import getFiles from 'ember-drop-zone/utils/get-files';
export default Ember.Component.extend({
getFiles
});
Then assign the getFiles
method to the getData
method of the DropZoneComponent
. This will change the behavior of the DropZoneComponent
so that it will extract files from the event.dataTransfer
object instead of text.
{{#drop-zone action=(action "doSomething") getData=getFiles}}
Drop files here...
{{/drop-zone}}
You can use the DroppableMixin
to create your own drop-zone.
// my-drop-zone.js
import Ember from 'ember';
import DroppableMixin from 'ember-drop-zone/mixins/droppable';
export default Ember.Component.extend(DroppableMixin, {
drop(event) {
// do something...
}
});
You can use the DraggableMixin
to create a draggable component. Add the DraggableMixin
to a component that you want to make draggable.
import Ember from 'ember';
import DraggableMixin from 'ember-drop-zone/mixins/draggable';
export default Ember.Component.extend(DraggableMixin, {
// ...
});
By default the DraggableMixin
will look for a model
on the component and send
the id
and type
of that model encoded as JSON to the event.dataTransfer
Object.
git clone <repository-url>
this repositorycd ember-drop-zone
npm install
bower install
ember serve
npm test
(Runs ember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit http://ember-cli.com/.
FAQs
Ember drop zone
The npm package ember-drop-zone receives a total of 30 weekly downloads. As such, ember-drop-zone popularity was classified as not popular.
We found that ember-drop-zone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.