I added link to context menu of img in ckeditor, using this code CKEditor - Add Context Menu Item to Images
How can I get the information about the image, on which user clicked? For example the id of the image. Or the path. In order to process with the selected image.
The solution was pretty easy.
$('body').on('contextmenu','img',function(){
var imgid = $(this).attr('id');
alert(imgid);
})
Using jquery to track click on image, we can save it's id to global variable. Then, inside the command of the plugin, to take the id that we saved before.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With