How to disable the TinyMCE confirmation dialog

Does anyone know how to disable TinyMCE alerts and confirms. The confirmation in the conversation says:

This page asks you to confirm that you want to leave - the data that you have entered cannot be saved. Leave Page - Stay on Page

I wrote my own materials that determine if these pages were changed, so I don’t want TinyMCE to worry. I found the function in the TinyMCE source, so I'm going to overwrite it, but I want to know if anyone knows the best way to achieve this. Thanks.

+7
source share
5 answers

To delete a message, simply disable the autosave plugin, which adds an onunload .

Just don't load the plugin into your TinyMCE script initialization.

+11
source

Upon request, I add this here to show my solution, which worked just fine:

My soul is thanks to the link provided by Madmartigan on the TinyMCE forum . Getting rid of the autosave plugin did not work, I wrote:

window.onbeforeunload = function() {}; 

And he got rid of the popup. It looks like it could be a bug with TinyMCE, since I have the initialization code, I copied their demo.

+8
source

I set it as a parameter during initialization (autosave_ask_before_unload):

 tinymce.init({ mode: 'textareas', menubar: false, statusbar: false, language: 'sv_SE', autosave_ask_before_unload: false, ... 
+3
source

None of the above answers worked for me with Joomla 3.3.2 and JCE 2.5.11. Although it worked: Inside the file -

components / com_jce / editor / tiny_mce / plugins / autosave / editor_plugin.js,

I changed

editor.getParam ("autosave_ask_before_unload", TRUE)

to

editor.getParam ("autosave_ask_before_unload", FALSE)

Apparently, when unloading autosave, it asks for a confirmation window. This completely disables upload confirmation. From what I tested, it worked in IE, Chrome and FF.

+1
source

If the problem is that the content is actually not dirty, perhaps because you replaced it programmatically, you can explicitly mark the editor as dirty as this:

 tinyMCE.activeEditor.isNotDirty = true 
0
source

All Articles