Question

I added the save plugin on TinyMCE 4 but it only enables the save button when some text change in the editor. Is it possible to enable the button in any other way?

Because I do have another text area that I would like to enable the save button when the text change on it.

Was it helpful?

Solution

Just set the "save_enablewhendirty" property to false. Then the save button will always be enabled.

tinyMCE.init({
    theme : "advanced",
    mode : "textareas",
    plugins : "save",
    theme_advanced_buttons3_add : "save",
    save_enablewhendirty : false,
    save_onsavecallback : "mysave"
});

OTHER TIPS

Have a look at the save plugin source. You could rename the plugin to an own name and change the prerequisites for a state change.

i.e. you could create the button and create a reference to the button

Her is an example from one of my own plugins

        // Register buttons
        editor.addButton('my_button',
        {
            title : 'my_button_desc',
            cmd : 'my_own_command',
            onPostRender: function() {
                editor.my_control = this;
            }
        });

You may activate the button by javascript using editor.my_control.active(1).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top