dracula
dracula copied to clipboard
option to disable node dragging
I need a way to disable dragging on some nodes.
Case test:
graph.addNode('Banana', { nodrag:true });
I changed the original code at bottom of drawNode():
node.shape.connections = [];
dragify(node.shape);
resulting in:
node.shape.connections = [];
if(!node.nodrag) {dragify(node.shape);}
Is there a better way to do it ?
Regards Andrea
It would be best to specify custom drag handlers, passing undefined for no drag or default. So there are three options: default drag, no drag, custom drag. imo this is most desirable for customizability. How to make the interface for this, I'm not sure. Maybe still keep the 'nodrag' option...
On a second thought, preventing the default drag and then manually hooking a custom one would be fine, too.
I have created a pull request https://github.com/strathausen/dracula/pull/47 for this. The switch is named noDefaultDrag
.