The .isDirty () editor does not work correctly. In our application, we check the Editor.isDirty () flag. When he evaluates the truth, we need to move forward with some action. If nothing has changed, we do not want to waste CPU time on evaluating data that has not changed. In our case, when the content is updated once, isDirty () is always evaluated as true. Even when nothing has changed.
The Editor.isDirty () function seems pretty simple:
isDirty : function() { var self = this; return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; }
The key seems to be a startContent property. What TinyMCE uses to determine the change has happened. Therefore, I would expect this property to be updated when save () is called in the editor. Looking at the code shows that this is not happening. Actually startContent does not reset wherever it is supported. Has anyone else seen this behavior, or am I using the Editor object incorrectly?
sidenote: TinyMCE version 3.5.7.
source share