fusionbox/django-widgy — pull request #209 by zmetcalf (2014-05-15 16:49:16+00:00)
Title: Replacing Fancybox with Bootstrap Modal

This is an incomplete pull request.

@rockymeza, can you please help me with shimming jquery with bootstrap in widgy? I ran into this same issue when I tried to shim fancybox with jquery too (I just assumed it could not be done with fancybox at the time.) I have tried a bunch of different configurations from people having similar issues. I also reviewed your shimming strategy in page_builder's markdown file. I also tested my setup in my test project to make sure I was not breaking any requirejs rules: https://github.com/zmetcalf/django-webdev/tree/master/bootstrap_modal

How I have it now is that I require the widgy.bootstrap.modal.js file in through widgy_field.html file (probably going to move it). Once the file loads, I have it do a requirjs.config to import the bootstrap file and shim it to jquery. (The exports jquery is just a leftover fragment that does not help or hurt). When it gets to the define call, jquery is working and the bootstrap file was served to the browser, but it is not shimmed with bootstrap so the call to $('myModal).modal('show') returns undefined function. Can you please help with what I am missing here?

BTW, I will end up gutting the Bootstrap CSS file because it breaks almost all the styling to the page.