I am working on blockly, I am having a scenario that I am having a block which is having an Image, I want to click on that Image and fire an event. I am not sure how can I do that. I have tried blcokly's documentation but there is no such mention. they are only providing onchange event on whole block, while an Image will be only a part of that block.
Any Idea How can I achieve this?
Thanks in advance.
I have got an idea to extend the field_image.js file, I have inherited the necessary files and in the init function I am adding an eventlistenr in the SVG element. That's how I made image clickable. following is the code -
after this in the block you have to add myFieldImage instead of using fieldImage. and isClickListener paramaeter will be passed from the block. following is the code -