I have two CKEditors, created by Liferay script, one by one in my view. Both are in seperated divs. I would like to change its order.
I try to use something like this:
var firstDivWithCKEditor = document.getElementById("firstDivWithCKEditor");
var secondDivWithCKEditor = document.getElementById("secondDivWithCKEditor ");
var parentDiv = secondDivWithCKEditor.parentNode();
parent.insertBefore(secondDivWithCKEditor , firstDivWithCKEditor);
The order is changed, but after this operation I can't do enything with on one editor and the html inside editor disapears. After clickling any button in editor I get error on a console: Uncaught TypeError: Cannot read property 'getSelection' of undefined.
Anyone has any idea what is wrong?
There's no way to do this with classic (
iframe
–based) editor instances. You can easily re–initialise your instances though (JSFiddle):