Hi,
I don't wont to use contenteditable attrib for element. How to enable CKeditor in inline editing in this sample:
<script>
window.onload = function() {
if ( window.addEventListener )
document.body.addEventListener( 'dblclick', onDoubleClick, false );
else if ( window.attachEvent )
document.body.attachEvent( 'ondblclick', onDoubleClick );
};
function onDoubleClick( ev ) {
var element = ev.target || ev.srcElement;
var name;
do {
element = element.parentNode;
}
while ( element && ( name = element.nodeName.toLowerCase() ) &&
( name != 'div' || element.id.indexOf( 'editable' ) == -1 ) && name != 'body' );
if ( name == 'div' && element.id.indexOf( 'editable' ) != -1 )
replaceDiv( element );
}
var editor;
function replaceDiv( div ) {
if ( editor )
editorr.destroy();
editor = CKEDITOR.replace( div );
}
</script>
<body>
<div id="editable">
<span>sample text</span>
</div>
</body>