Opened 10 years ago
Last modified 9 years ago
#12891 confirmed Bug
Inline mode + Widgets( codeSnippet or formula ): CheckDirty() always returns "true" after page is loaded
Reported by: | Airocat | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.3 Beta |
Keywords: | Cc: | airocat@…, michele.dolfi@… |
Description (last modified by )
checkDirty() function does not work properly with CodeSnippet and Mathematical plugins in Inline mode.
If there is a codesnippet or a formula in the ckeditor element, CheckDirty() always returns "true" after page has been loaded.
Steps to reproduce:
- Select any editable element on the page and add codeSnippet or a Formula
- Save the element and reload the page
- Execute in JS console:
CKEDITOR.instances.editor_instance.checkDirty()
where editor_instance is id of the element. It will return "True" but it should be "False"
This issue emerges only in Inline mode, not in classic mode.
Software versions:
Ckeditor: 4.4.7 (custom build)
OS: Ubuntu 12.04 x86_64
Browsers: Chrome 40 and Firefox 35 (latest versions at this time)
Edit: Please also see comment:8 because this issue also occurs when you just load the editor (checked in CKEditor 4.5.6 at the time of writing).
Attachments (1)
Change History (10)
Changed 10 years ago by
Attachment: | build-config.js added |
---|
comment:1 Changed 10 years ago by
Cc: | airocat@… added |
---|
comment:2 Changed 10 years ago by
Summary: | Inline mode + Widgets( codeSnippet or formula ): CheckDirty() always returns "true" after page is Loaded → Inline mode + Widgets( codeSnippet or formula ): CheckDirty() always returns "true" after page is loaded |
---|
comment:3 Changed 10 years ago by
I can confirm that this is happening in default samples. To reproduce, I have modified inline editor part accordingly.
var e2 = CKEDITOR.inline( 'editable', CKEDITOR.tools.extend( {}, config, { extraPlugins: 'codesnippet' }, true ) ); console.log( e2.checkDirty() ); e2.on( 'instanceReady', function(){ console.log( e2.checkDirty() ); setTimeout( function(){ console.log( e2.checkDirty() ); }, 1000); });
I was only able to reproduce this problem in mathjax and codesnippet samples.
comment:4 Changed 10 years ago by
Status: | new → confirmed |
---|
In case of codesnippet, the highlighting markup is not applied in CKEDITOR.instances.editable._.previousValue
(only in inline).
So getSnapshot returns HTML with following widget innerHTML:
<span class="hljs-keyword">for</span> ( <span class="hljs-keyword">var</span> i <span class="hljs-keyword">in</span> object ) { (...)
While previousValue has plain text:
for ( var i in object ) { (...)
comment:5 Changed 10 years ago by
Version: | 4.4.7 → 4.3 Beta |
---|
From what I have checked, this issue can be reproduced from CKEditor 4.3 beta.
comment:7 Changed 10 years ago by
I just ran across this. It seems to be the case(for formula at least) that it doesn't matter if it's inline or not. It's reproducible from the mathjax demo page(http://sdk.ckeditor.com/samples/mathjax.html). Just load that page, open a console and CKEDITOR.instances.editor1.checkDirty() returns true instead of false.
comment:8 Changed 9 years ago by
Cc: | michele.dolfi@… added |
---|
comment:9 Changed 9 years ago by
Description: | modified (diff) |
---|
@joncostello - from what I have checked MathJax returns true for both editors while Code Snippet returns true only for inline editor. It is enough to load editors in that case and execute checkDirty()
method.
build config