jejacks0n / mercury

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

$ Conflict w/ mercury.js - can't modify DOM #318

Closed nozpheratu closed 11 years ago

nozpheratu commented 11 years ago

I'm using Pines Notify for some fancy JQuery notifications. I found it worked really well for status updates from ajax requests to the server in my Rails application. Sadly there seems to be some sort of conflict between mercury and pines notify for the $ variable.

Is there any way I can rectify this? I think pnotify would look great with the mercury editor.

gvarela commented 11 years ago

Can you provide more information or a sample project? There is not enough of an explanation in your issue for us to help you.

Thanks

Gabe Varela

On Jan 16, 2013, at 4:41 PM, Cyle Hunter notifications@github.com wrote:

I'm using Pines Notify for some fancy JQuery notifications. I found it worked really well for status updates from ajax requests to the server in my Rails application. Sadly there seems to be some sort of conflict between mercury and pines notify for the $ variable.

Is there any way I can rectify this?

— Reply to this email directly or view it on GitHub.

nozpheratu commented 11 years ago

Upon further testing it isn't just pnotify. I don't think I'm able to modify the DOM with jQuery period wherever the Mercury editor JS is being loaded. This can be reproduced on the Mercury Editor demo page here with the following which would typically append html to an element under normal circumstances:

$('#marketing').append($("<h1>Foo</h1>"));

Can anybody instruct on the proper fix?

jejacks0n commented 11 years ago

It's because the #marketing element is actually within an iframe.. this is to keep libraries separated, and basically means that you'll never see conflicts.

window.frames[0].$("#marketing")
nozpheratu commented 11 years ago

Ah! That explains a lot actually. Thank you for the explanation!