Textbox.io 2.x Documentation : editor.events.dirty.addListener()

Add a custom event listener to a Textbox.io editor dirty event with editor.events.dirty.addlistener().

You can detect that content has changed on an editor instance by attaching a callback function to the dirty event.

The dirty event only occurs when an instance's content has been updated or changed since it was set. See editor.content.isDirty() for more detail on the editor 'clean' and 'dirty' states.

 

Example

editor.events.loaded.addListener(callback)
// Add a custom event listener to the content dirty event
editor.events.dirty.addListener(function() {
        alert('The editor content is now dirty.');
    });
};

Parameters

callbackFunctionFunction executed when the editor's content state is considered dirty.

Returns

No return value.