Fix crash that occurred when editor was created twice

Apparently the editor doesn't like it when it's added to an element that
isn't attached to the DOM. This workaround waits for the creation until
the element is added.