CKEditor inline toolbar position
Asked Answered
G

2

9

Simple question : how can I make the inline CKEditor toolbar float top right (or bottom right) of my editable element instead of the default top left position ?

Have been googling it but no luck so far :(

Thank you

Greensickness answered 5/6, 2013 at 19:13 Comment(0)
G
5

It does not have a configuration option for this. There are only four options for the X,Y offset in pinned and docked modes - e.g. config.floatSpacePinnedOffsetY.

The only idea that I have is implementing your own plugin like Floating Space, or modifying the current implementation.

And as the last resort, you can use the Shared Space plugin to place the toolbar in a container chosen by you and then position it as you wish. Check the second demo (Inline Editor with Shared Toolbar and Bottom Bar) on the SDK sample page for an example.

Georginageorgine answered 5/6, 2013 at 20:4 Comment(2)
ckeditor.com/demo#inline has examples of left/right aligned inline toolbars, this is what I am looking for. I guess I could do a right:0 css rule with it but it will be overwritten if any modification is done on window size. Can you add a %age offset ? That would sort it out I guess.Greensickness
I believe the toolbar with left or right align depending on how close the element it is editing is to the right side of the page. It tries to avoid rendering in a way where part of it will be off the screen.Amphetamine
P
1

we can do it with floatSpacePreferRight config

only we need to set

config.floatSpacePreferRight = true;

default value of floatSpacePreferRight is false;

so with this configuration, we can align inline toolbar position to right

Pantry answered 30/7, 2020 at 8:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.