Does anyone know how to disable TinyMCE alerts, and confirms. The confirm in talking about says:
This page is asking you to confirm that you want to leave - data you have entered may not be saved Leave Page - Stay on Page
I've written my own stuff that detects if the page data has been change so I don;t want TinyMCE to worry. I found the function in the TinyMCE source so I'm about to overwrite it but I want to know if anyone knows a better way to accomplish this. Thanks.
I set it as a param when initializing (autosave_ask_before_unload):
tinymce.init({
mode: 'textareas',
menubar: false,
statusbar: false,
language: 'sv_SE',
autosave_ask_before_unload: false,
...
To remove the message, just disable the autosave
plugin, that's what adds the onunload
prompt.
Simply don't load the plugin in your TinyMCE initialization script.
As per a request I'm adding this here to show my solution which has worked great:
My solution thanks to a link provided by Madmartigan, on the TinyMCE forum. Getting rid of the autosave plugin did not work, I ended up writing this:
window.onbeforeunload = function() {};
And it got rid of the popup. Looks like it could be a bug with TinyMCE, since the init code I have I copied off their demo.
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