jejacks0n/mercury

hijackLinksAndForms on AJAX loaded content

Kezino opened this issue · 3 comments

Greetings!

It happens that some content is loaded via AJAX and contains links. This newly fetched content is not digested with hijackLinksAndForms function, which leads to malfunction of links (they are opened within iFrame, not parent Mercury window). Please, advice where and how to bind the ajaxSuccess event on the iFrame. Thank you in advance.

I'm not positive, but if you reinitialize mercury (using the event), does this not happen? In general if you're loading content into the page, or drawing it with javascript you have to tell mercury about potential new regions etc.. if this doesn't happen naturally on reinit, you should add it as a pull request.

OK, closing this issue. Created a custom Toolbar button to reinitialize the editor.

P.S. Another solution is to add into section if Mercury Editor is active. Hope it helps someone save time.