TinyMCE:API/tinymce.Editor/isNotDirty

From Moxiecode Documentation Wiki

Jump to: navigation, search

Property: isNotDirty

Summary

The isDirty method returns true if the contents of the editor haven't been saved. But once you save the contents though for example an Ajax call you want to tell the editor that it's no longer dirty. If you set this state to true the isDirty method will return false until a new undo level is added i.e. if the user changes some content inside the editor.

Example

function ajaxSave() {
    var ed = tinyMCE.get('elm1');

    // Save contents using some XHR call
    alert(ed.getContent());

    ed.isNotDirty = 1; // Force not dirty state
}
Personal tools