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

Adding Bootstrap.js file with the Mercury_loader.js file (without rails version) #290

Closed kshitizshankar closed 11 years ago

kshitizshankar commented 12 years ago

Hi,

I am trying to add the bootstrap.js file in the development package in mercury_loader.js. I am using few components of bootstrap in one of the panels.

Now when I load a page which also contains the bootstrap.js file as one of the scripts, it starts messing up my components in the editor (in a custom panel).

I tried to setup bootstrap in a similar scenario (a parent window and an iframe, both contain the bootstrap.js files) and it works. http://jsfiddle.net/mmfansler/wxeY7/

I was unable to pin point the exact problem, but I checked that my bootstrap events start getting fired twice.

jejacks0n commented 12 years ago

This would be the case.. The loader script is a beast.. and I only provided it for folks using Mercury outside of rails.

The loader works like this:

That's why you're seeing the double load of bootstrap -- the problem can arise in many ways with the loader technique. You may want to look at how the Rails setup behaves and duplicate that in your environment. That way you won't have the issue.

kshitizshankar commented 12 years ago

hmm ok, I'll try to go through the rails environment.

jejacks0n commented 11 years ago

The loader script is going away in Mercury 2. Hopefully you were able to work it out.