Roy Shoa
Roy Shoa

Reputation: 3195

CKEditor 4 inline - How to show the toolbar on a object without focusing it

When i use "CKEDITOR.inline(myId)" its applying the editor instance to the object but its not apply the toolbar to it if i do not focus the object.

In my case, I do not like to focus the object on start-up because its scroll the page to the start/end (IE browser focus to the end of the page).

Are there is a way to apply and show the toolbar to a object without focusing it?

Note: "startupFocus" property is not good for me because I do not like to focus the object, I just like the toolbar up to it without focusing the object.

Upvotes: 0

Views: 2465

Answers (1)

oleq
oleq

Reputation: 15895

At the moment, there's no such possibility without focusing the editor like this:

CKEDITOR.instances.yourEditorInstance.focus();

You can take a look into floatingspace plugin which is responsible for toolbars of inline editors. You can try (pure guessing) something like this:

var instance = CKEDITOR.instances.editable;
var toolbar = CKEDITOR.document.getById( instance.ui.spaceId( 'top' ) );
toolbar.show();

...however it won't show the toolbar until you call layout() which is a private function at the moment an needs to be (somehow) exposed. This might be a little bit tricky and may lead to some conflicts and troubles since editor has never been designed to work like this and, trust me, you don't want to fight with it.

Good luck, anyway! ;)

Upvotes: 1

Related Questions