Merge pull request #1304 from edx/db/fix-requirejs-jquery
Ensure that jQuery loads before any other JS dependency
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user