🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

ember-dnd-helpers

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-dnd-helpers

Collection of helpers to assist in building drag and drop interfaces

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

ember-dnd-helpers

+Build Status +npm version +Dependency Status

(drag-set 'plain/text' 'some text')

Use in ondragstart event handler to set data on the event. (drag-set 'plain/text' 'some text') is equivalent to calling event.dataTrasfer.setData('plain/text') in the event handler.

<div draggable="true" ondragstart={{action (drag-set 'plain/text' 'some text')}}></div>

This helper can accept application/json mime type in which case it will JSON.stringify the received data.

<div draggable="true" ondragstart={{action (drag-set "application/json" (hash id=123 color='red'))}}></div>

(drag-get 'plain/text')

Use in ondrop event handler to retrieve data set with event.dataTransfer.setData. (drag-get 'plain/text') is equivalent to event.dataTransfer.getData('plain/text').

<div ondrop={{action (pipe (prevent-default) (drag-get 'plain/text') (action 'dosomething'))}}></div>

This helper can accept application/json mime type in which case it will JSON.parse the received data.

(prevent-default)

Calls event.preventDefault().

`(stop-propagating)

Calls event.stopPropagating().

(drop-effect 'move')

Applies specified drop effect onto the event. Equivalent to calling even.dropEvent = move;

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://ember-cli.com/.

Credits

Thank you Miguel Camba for suggesting to try doing drag and drop with pure events.

Keywords

ember-addon

FAQs

Package last updated on 19 Jul 2016

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