diff --git a/.gitignore b/.gitignore index ee8bea9..6f547a0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ logs # Dependency directory node_modules +package-lock.json # build files build diff --git a/src/orgchart.js b/src/orgchart.js index 5711a78..6caff99 100644 --- a/src/orgchart.js +++ b/src/orgchart.js @@ -1179,11 +1179,15 @@ export default class OrgChart { let ghostNodeWrapper = document.createElement('img'); ghostNodeWrapper.src = 'data:image/svg+xml;utf8,' + (new XMLSerializer()).serializeToString(ghostNode); - event.dataTransfer.setDragImage(ghostNodeWrapper, xOffset, yOffset); + if(opts.useGhostImage){ + event.dataTransfer.setDragImage(ghostNodeWrapper, xOffset, yOffset); + } nodeCover.setAttribute('fill', 'rgb(255, 255, 255)'); nodeCover.setAttribute('stroke', 'rgb(191, 0, 0)'); } else { - event.dataTransfer.setDragImage(ghostNode, xOffset, yOffset); + if(opts.useGhostImage){ + event.dataTransfer.setDragImage(ghostNode, xOffset, yOffset); + } } } let dragged = event.target,