Opened 10 years ago
Last modified 10 years ago
#12547 confirmed Bug
Changes in docprops dialog do not make the editor "dirty"
Reported by: | jhub | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.6 |
Keywords: | Cc: |
Description
When working in full page mode, if you open the editor for a given page, then use the docprops dialog to change a document setting, for example the background color, but you do not make any other changes, then CKEDITOR.editor.checkDirty() will still return false, so the changes will not be saved if saving is done only if checkDirty() returns true.
This is because checkDirty() and resetDirty() use only getSnapshot(), which returns the document body, but all changes in the docprops dialog are outside of the body.
Suggested change:
In checkDirty():
if (this.config.fullPage) return this.status == 'ready' && this._.previousValue !== this.getData(); else return this.status == 'ready' && this._.previousValue !== this.getSnapshot();
and in resetDirty():
if (this.config.fullPage) this._.previousValue = this.getData(); else this._.previousValue = this.getSnapshot();
Problem can be reproduced from CKEditor 3.6.
The only thing that has any effect on checkDirty (at least since 4.0) is setting text direction to RTL because it is actually set on the body.