Fuxi
Fuxi

Reputation: 7599

CKEditor - inline: showing up in disabled mode

i'm trying to use CKEditor in inline mode like the following:

var div = $("div.content");
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline( div[0]);

when clicking the div, the CKEditor toolbar will show up, but all buttons are disabled and i can't edit anything. When using CKEDITOR.replace(..) - i'm getting the normal editor and anything works fine. any ideas what's wrong with the inline setup? thanks

Upvotes: 2

Views: 1909

Answers (1)

Reinmar
Reinmar

Reputation: 22023

That element (div.content) needs to have a contenteditable attribute set to true. Without it, it's in normal, read-only mode.

var div = $( 'div.content' );
div.attr( 'contenteditable', 'true' );
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline( div[ 0 ] );

Upvotes: 1

Related Questions