New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not opening child nodes on click of .relatedBox. Node moves instead #15
Comments
I have seen this problem intermittently, which makes this problem very confusing. However I believe adding the following to ml-lodlive fixes the issue. container.on('mousedown', draggableSelector, function(event) {
// mark the node as being dragged using event-delegation
dragState.target = $(this).parent(); // UPDATED to use the parent so the drag works as normal
dragState.panning = false;
// store offset of event so node moves properly
dragState.offsetX = event.offsetX;
dragState.offsetY = event.offsetY;
event.stopPropagation();
event.preventDefault();
}); renderer.js LodLiveRenderer.prototype.init = function(inst, container) {
var renderer = this;
if (typeof container === 'string') {
container = $(container);
}
if (!container.length) {
throw new Error('LodLive: no container found');
}
// TODO: move styles to external sheet
this.container = container.css('position', 'relative');
this.context = $('<div class="lodlive-graph-context"></div>');
var graphContainer = $('<div class="lodlive-graph-container"></div>');
this.context.appendTo(this.container).wrap(graphContainer);
var draggable = require('./draggable.js');
// UPDATED .lodlive-node to .lodlive-node-label stops the parent swallowing all the events
draggable(this.container, this.context, '.lodlive-node-label', function(dragState) {
return renderer.reDrawLines(dragState.target);
});
this.initHover();
this.initClicks(inst);
}; I'll raise a PR on ml-lodlive but i'd be surprised if it gets considered as i'm still convinced the problem is packaging/dependency related. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you click one of a node's .relatedBox circles it doesn't open the child node.
On the demo page: it causes the whole parent node to move instead.
I've done some digging, as i'm getting a similar problem on my own extension.
It seems draggable.js is hooving up all the clicks.
Could this be a packaging error? As i assume this works fine on ml-lodlive?
The text was updated successfully, but these errors were encountered: