alphagov/limelight — pull request #29 by abersager (2013-04-08 14:11:08+00:00)
Title: Debug ie

Application would not load correctly in IE when following a link, only after a reload. The cause was a race condition. Require baseUrl configuration would sometimes be read from wrapper element before DOM was ready.

Now, the app simply uses the global jQuery object provided by the Static project. This allows us to use $(document).ready to defer loading the configuration until the DOM is ready.

Additionally, a 'jqueryloader' shim module provides the AMD module named 'jquery'. This is required since jQuery is initially loaded manually, not as an AMD module. However, the jquery.mousewheel plugin used by us detects an AMD setup and defines 'jquery' as its dependency. The shim also means that other modules can also safely use 'jquery' as a dependency.

A few drive-by improvements:
- A "d3loader" module now only includes d3 when it is required. The main reason for this is not saving on bandwidth but that d3 throws an error during parsing on IE6-8.
- Removed leftovers from the backbone boilerplate used.