Opened 11 years ago
Last modified 11 years ago
#11909 closed New Feature
Parameter to prevent creating snapshots on editor#setData — at Version 2
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.4.2 |
Component: | General | Version: | 4.4.0 |
Keywords: | Cc: |
Description (last modified by )
Editor setData
method now generates undo snapshot (Please see: #5217).
Right after the release we got two questions from users that were benefiting from editor.setData('')
not generating snapShots.
Their request is that setData should have extra parameter that blocks snapShot execution what in result can block change event and leave dirty flag set to false.
Things like that can be easily worked around with below code, thus I would like to ask if there is anyone for whom below workarounds don't work and parameter is the only solution?
var editor = CKEDITOR.replace( 'editor1', {}); editor.on('instanceReady', function(){ console.log('Before setData:'+editor.checkDirty()); editor.setData('',function(){ console.log('Inside setData before reset:'+editor.checkDirty()); editor.resetDirty(); console.log('Inside setData after reset:'+editor.checkDirty()); }); });
var editor = CKEDITOR.replace( 'editor1', {}); editor.on('instanceReady', function(){ editor.setData(''); }); editor.on('afterSetData', function(){ console.log('After setData before reset:'+editor.checkDirty()); editor.resetDirty(); console.log('After setData after reset:'+editor.checkDirty()); },null,null,100);
Change History (2)
comment:1 Changed 11 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Summary: | Parameter to block firing snapShots in setData → Parameter to prevent creating snapshots on editor#setData |