I am using the following code to call ckeditor inline on a page:
$(document).ready(function() {
CKEDITOR.disableAutoInline = true;
$("div[contenteditable='true']" ).each(function( index ) {
var pk = $(this).attr('data-pk');
var name = $(this).attr('id');
var editor = CKEDITOR.inline( name, {
enterMode : CKEDITOR.ENTER_BR,
on: {
instanceReady: function() {
periodicData();
}
}
} );
var periodicData = ( function(){
var data;
var oldData = '';
return function() {
if ( ( data = editor.getData() ) !== oldData ) {
oldData = data;
//console.log( data );
var request = jQuery.ajax({
url: "/manager/sales/EditNotesPost.php",
type: "POST",
data: {
value : data,
pk : pk,
name : name
},
dataType: "html",
});
}
setTimeout( periodicData, 1000 );
};
})();
});
});
My problem is the "enterMode : CKEDITOR.ENTER_BR," config is not working. If I use the blur method instead of instanceReady it works. Ideas?
Nevermind. Seems to be
Nevermind. Seems to be working now. Here is the code I ended up with in case some comes looking for an auto saving with blur inline editor: