use domReady rather than $.ready()

This commit is contained in:
David Baumgold
2013-10-12 13:24:30 -04:00
parent aeae35344a
commit 061e046e2d

View File

@@ -7,29 +7,26 @@
<%block name="jsextra">
<script type="text/javascript">
require(['jquery', 'jquery.form'], function($) {
$(document).ready(function () {
require(["domReady!", "jquery", "jquery.form"], function(doc, $) {
// showing/hiding creation rights UI
$('.show-creationrights').click(function(e){
(e).preventDefault();
$(this).closest('.wrapper-creationrights').toggleClass('is-shown').find('.ui-toggle-control').toggleClass('current');
});
// showing/hiding creation rights UI
$('.show-creationrights').click(function(e){
(e).preventDefault();
$(this).closest('.wrapper-creationrights').toggleClass('is-shown').find('.ui-toggle-control').toggleClass('current');
});
var reloadPage = function () {
location.reload();
};
var reloadPage = function () {
location.reload();
};
var showError = function () {
$('#request-coursecreator-submit').toggleClass('has-error').find('.label').text('Sorry, there was error with your request');
$('#request-coursecreator-submit').find('.icon-cog').toggleClass('icon-spin');
};
var showError = function () {
$('#request-coursecreator-submit').toggleClass('has-error').find('.label').text('Sorry, there was error with your request');
$('#request-coursecreator-submit').find('.icon-cog').toggleClass('icon-spin');
};
$('#request-coursecreator').ajaxForm({error: showError, success: reloadPage});
$('#request-coursecreator').ajaxForm({error: showError, success: reloadPage});
$('#request-coursecreator-submit').click(function(e){
$(this).toggleClass('is-disabled is-submitting').find('.label').text('Submitting Your Request');
});
$('#request-coursecreator-submit').click(function(e){
$(this).toggleClass('is-disabled is-submitting').find('.label').text('Submitting Your Request');
});
});
</script>