Opened 10 years ago

Last modified 10 years ago

#11909 closed New Feature

Parameter to block firing snapShots in setData — at Initial Version

Reported by: Jakub Ś Owned by:
Priority: Normal Milestone: CKEditor 4.4.2
Component: General Version: 4.4.0
Keywords: Cc:

Description

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 (0)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy