Closed rohitkrishna094 closed 6 years ago
Hey I think this PR isn't completely done. When I click point tool, we are still able to move other shapes. However if we click on canvas one extra time, then the other shapes are not draggable. I am not sure where the event handler is for this. Could you please check it. Thanks.
All the event handlers related to workarea / SVG canvas are in workarea.tag.html
If I clicked on the point tool, how do I trigger that event? Because point tool is on toolbar div which is not part of workarea.tag. I tried using $(#toolbar).on('click', ....)
but the problem with that approach is that I am unable to access the selectedTool
property (which I believe is being passed by riot?) because this jquery runs before selectedTool is initialized. So if I try to access selectedTool
property inside this jquery onclick event, its null. I can access selectedTool in myCanvas.on event handler though. The problem with that is as I mentioned in my previous comment.
in case of riot, if you need to use jquery selectors or bind any event do it in this.on('mount',function(){});
. This is called once the component is rendered. Check like#57 in workarea.tag.html
However, I believe this issue can be fixed by just preventing event propagation when point tool is selected
e.preventDefault();
e.stopPropagation();
This PR is not valid anymore.
Purpose / Goal
This tries to fix issue #30 .
Type
Please mention the type of PR
Note : Please ensure that you've read contribution guidelines before raising this PR.