Commit 3e9c09e0 by David Baumgold

Ensure that jQuery loads before any other JS dependency

parent cf66d0a5
require(["jquery", "underscore", "gettext", "js/views/feedback_notification", "js/views/feedback_prompt",
require(["domReady", "jquery", "underscore", "gettext", "js/views/feedback_notification", "js/views/feedback_prompt",
"jquery.ui", "jquery.timepicker", "jquery.leanModal", "jquery.form", "jquery.smoothScroll"],
function($, _, gettext, NotificationView, PromptView) {
function(domReady, $, _, gettext, NotificationView, PromptView) {
var $body;
var $modal;
......@@ -12,7 +12,7 @@ var $newComponentTypePicker;
var $newComponentTemplatePickers;
var $newComponentButton;
$(document).ready(function() {
domReady(function() {
$body = $('body');
$modal = $('.history-modal');
$modalCover = $('.modal-cover');
......
......@@ -159,9 +159,14 @@ var require = {
deps: ["coffee/src/ajax_prefix"]
}
},
// load these automatically
deps: ["jquery", "js/base", "coffee/src/main", "coffee/src/logger", "datepair"]
// we need "datepair" because it dynamically modifies the page when it is loaded -- yuck!
// load jquery automatically
deps: ["jquery"],
callback: function() {
// load other scripts on every page, after jquery loads
require(["js/base", "coffee/src/main", "coffee/src/logger", "datepair"]);
// we need "datepair" because it dynamically modifies the page
// when it is loaded -- yuck!
}
};
</script>
<script type="text/javascript" src="${static.url("js/vendor/require.js")}"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment