jejacks0n / mercury

Mercury Editor: The Rails WYSIWYG editor that allows embedding full page editing capabilities directly inline.
http://jejacks0n.github.com/mercury
Other
2.64k stars 531 forks source link

Using mercury to replace existing editor #472

Open johnswebdev opened 9 years ago

johnswebdev commented 9 years ago

Is it possible to use mercury in the following (non rails) environment to replace an existing editor

This is in an admin area. The main admin loads once and once only The page with the editable area is loaded by ajax later and only then is just the editable area of the page is to be come editable

If the above is possible with mercury, could you provide some pointers John

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5161769-using-mercury-to-replace-existing-editor?utm_campaign=plugin&utm_content=tracker%2F134071&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F134071&utm_medium=issues&utm_source=github).
ghost commented 9 years ago

Does the Ajax page get on top of the normal page or are u using a lightbox or something similar? If u use a lightbox it will work. With pure Ajax you need to set the mercury editor again I guess

johnswebdev commented 9 years ago

The page with the editable sections gets loaded into a part of the page, not in a lightbox like way, but as an integral part of the page ( in a div ). For most editors this means that I have to call the functionality that is normally executed on DOM ready, on completion of the load instead. I am not sure that mercury would work in this way

ghost commented 9 years ago

I think it will but you can link the mercury init function to the ajax load function you perform to load the page.