* Explicitly sets the dirty state. This will fire the dirty event if the editor dirty state is changed from false to true * by invoking this method. * * @method setDirty * @param {Boolean} state True/false if the editor is considered dirty. * @example * const ajaxSave = () => {
(state: boolean)
| 957 | * } |
| 958 | */ |
| 959 | public setDirty(state: boolean): void { |
| 960 | const oldState = !this.isNotDirty; |
| 961 | |
| 962 | this.isNotDirty = !state; |
| 963 | |
| 964 | if (state && state !== oldState) { |
| 965 | this.dispatch('dirty'); |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | /** |
| 970 | * Returns the container element of the editor. The container element includes |
no test coverage detected