Commit 061e046e by David Baumgold

use domReady rather than $.ready()

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