@layer5/cytoscape-compound-drag-and-drop
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -127,6 +127,7 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
const canBeGrabbed = n => options.grabbedNode(n); | ||
const canBeGrabbed = n => options.grabbedNode(n); // 1. if the given node is a parent, then we check whether it is allowed by options | ||
const canBeDropTarget = n => !n.same(this.grabbedNode) && (options.dropTarget(n, this.grabbedNode) || isParent(n)); | ||
const canBeDropTarget = n => !n.same(this.grabbedNode) && options.dropTarget(n, this.grabbedNode); | ||
const canPullFromParent = n => isChild(n); | ||
@@ -133,0 +134,0 @@ |
{ | ||
"name": "@layer5/cytoscape-compound-drag-and-drop", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Drag-and-drop UI for creating and editing the children of compound parent nodes", | ||
@@ -5,0 +5,0 @@ "main": "@layer5/cytoscape-compound-drag-and-drop.js", |
@@ -9,3 +9,3 @@ const nodemon = require("nodemon"); | ||
ignore: ["dist", "script", "test"], | ||
exec: `npm run build; cp @layer5/cytoscape-compound-drag-and-drop.js` + MESHMAP_PATH + `/node_modules/@layer5/cytoscape-compound-drag-and-drop/@layer5/cytoscape-compound-drag-and-drop.js` | ||
exec: `npm run build; cp @layer5/cytoscape-compound-drag-and-drop.js ` + MESHMAP_PATH + `/node_modules/@layer5/cytoscape-compound-drag-and-drop/@layer5/cytoscape-compound-drag-and-drop.js` | ||
}); | ||
@@ -12,0 +12,0 @@ |
@@ -22,6 +22,8 @@ const { | ||
const canBeGrabbed = n => options.grabbedNode(n); | ||
const canBeDropTarget = n => !n.same(this.grabbedNode) && (options.dropTarget(n, this.grabbedNode) || isParent(n)); | ||
// 1. if the given node is a parent, then we check whether it is allowed by options | ||
const canBeDropTarget = n => !n.same(this.grabbedNode) && (options.dropTarget(n, this.grabbedNode)); | ||
const canPullFromParent = n => isChild(n); | ||
const getBoundTuplesNode = n => getBoundsTuple(n, options.boundingBoxOptions); | ||
const canBeInBoundsTuple = n => (!isParent(this.grabbedNode) || !this.grabbedNode.descendants().anySame(n)) && (canBeDropTarget(n)) && !n.same(this.dropTarget); | ||
@@ -32,2 +34,3 @@ const updateBoundsTuples = () => this.boundsTuples = cy.nodes(canBeInBoundsTuple).map(n => { | ||
const reset = () => { | ||
@@ -34,0 +37,0 @@ this.grabbedNode.removeClass('cdnd-grabbed-node'); |
54293
936