Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron-drag-drop

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-drag-drop - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

examples/type/index.html

17

lib/drag.js

@@ -58,5 +58,5 @@ 'use strict';

// NOTE: https://github.com/atom/electron/issues/1276
dataTransfer.setData('text', type);
dataTransfer.setData('drag/type', type);
dataTransfer.setData('drag/items', JSON.stringify(items));
// dataTransfer.setData('text', type);
// dataTransfer.setData('drag/type', type);
// dataTransfer.setData('drag/items', JSON.stringify(items));
dataTransfer.effectAllowed = effect;

@@ -113,3 +113,3 @@ dataTransfer.dropEffect = 'none';

// check if this is a file type
if ( dataTransfer.files.length > 0 ) {
if ( dataTransfer.types.indexOf('Files') !== -1 ) {
return 'file';

@@ -169,2 +169,3 @@ }

// try to extract items from files
// NOTE: only available in `drop` event
if ( dataTransfer.files.length > 0 ) {

@@ -253,2 +254,10 @@ let results = new Array(dataTransfer.files.length);

/**
* @method getLength
* @return {number}
*/
drag.getLength = function () {
return _items.length;
};
/**
* @property {boolean} dragging

@@ -255,0 +264,0 @@ */

@@ -71,4 +71,4 @@ 'use strict';

// 2. check if we follow the multi drop rule
let dragItems = drag.items(event.dataTransfer);
if ( !this.multi && dragItems.length > 1 ) {
let length = dragType === 'file' ? event.dataTransfer.items.length : drag.getLength();
if ( !this.multi && length > 1 ) {
this._canDrop = false;

@@ -95,3 +95,3 @@ return;

dragType: dragType,
dragItems: dragItems,
dragItems: drag.items(event.dataTransfer),
dragOptions: drag.options(),

@@ -98,0 +98,0 @@ }

{
"name": "electron-drag-drop",
"version": "1.0.3",
"version": "1.1.0",
"description": "Easily manipulate drag and drop in Electron.",
"main": "index.js",
"scripts": {
"start": "node run.js",
"start": "electron",
"test": "mocha test/*.spec.js"

@@ -26,3 +26,3 @@ },

"devDependencies": {
"electron": "^1.4.15",
"electron": "^1.8.1",
"mocha": "^3.2.0",

@@ -29,0 +29,0 @@ "spectron": "^3.6.0"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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