JavaScript hook on block deletion
Permalink
Hi folks,
I want to perform some JavaScript code when a block is deleted. In particular I want to remove an image from the HTML-tree that is not part of the block's removed XML structure.
Is it possible to hook into the deletion process of a block?
Thanks in advance,
David
I want to perform some JavaScript code when a block is deleted. In particular I want to remove an image from the HTML-tree that is not part of the block's removed XML structure.
Is it possible to hook into the deletion process of a block?
Thanks in advance,
David
If you still want to do it all with javascript, in edit mode, deleting a block is an ajax transaction between the browser and the server, so it should be possible to adapt the javascript involved to trigger a javascript event that you could then listen for and remove the unwanted image. You could also simulate such an event with a polling loop. You would then need to use javascript to simulate the C5 process for removing the image with further ajax transactions.