Cancel event fired on clicking the "x" in the editor form
Cancel event fired on clicking the "x" in the editor form

Hello everyone,
I want to execute a function when the editor form is aborted by the "x" button. I have already looked if there is a suitable event for this, but I couldn't find one. With the help of the events "close" or "preClose" I could not achieve the required effect.
So does anyone have a suggestion how to execute a function when the "x" was clicked? I expected something like a "cancel" event.^^
Greetings
Daniel
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Why not? What was the problem?
If you only want to execute the function in case the change was cancelled with the "x" button you can use your browser's inspector and figure out how to find the button using jQuery or Javascript:
You would find the "close" button inside a div with the class DTE_Header. All you need is to get the selector right, I guess.
Something like this could work:
Put the jQuery into an Editor event handler to make sure the DOM elements exist when the code is executed. On “opened“ should work for this.
Hey rf1234,
thanks for your reply that looks like it will solve my problem. I will try this out.