Commit 0a9db940 by Usman Khalid

Merge pull request #1316 from edx/usman/lms930-unregister-button-broken

Setup leanModel handlers on jQuery.ready() so that the rest of the scripts get a chance to load before modals can be activated.
parents 6c087081 91fbc661
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
} }
}); });
$(document).ready(function($) {
$("a[rel*=leanModal]").each(function(){ $("a[rel*=leanModal]").each(function(){
$(this).leanModal({ top : 120, overlay: 1, closeButton: ".close-modal", position: 'absolute' }); $(this).leanModal({ top : 120, overlay: 1, closeButton: ".close-modal", position: 'absolute' });
embed = $($(this).attr('href')).find('iframe') embed = $($(this).attr('href')).find('iframe')
...@@ -100,4 +101,5 @@ ...@@ -100,4 +101,5 @@
} }
} }
}); });
});
})(jQuery); })(jQuery);
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
$("#unenroll_course_id").val() + "&enrollment_action=unenroll"; $("#unenroll_course_id").val() + "&enrollment_action=unenroll";
} else { } else {
$('#unenroll_error').html( $('#unenroll_error').html(
xhr.responseText ? xhr.responseText : "An error occurred. Please try again later." xhr.responseText ? xhr.responseText : "${_('An error occurred. Please try again later.')}"
).stop().css("display", "block"); ).stop().css("display", "block");
} }
}); });
...@@ -56,11 +56,10 @@ ...@@ -56,11 +56,10 @@
{"new_email" : new_email, "password" : new_password}, {"new_email" : new_email, "password" : new_password},
function(data) { function(data) {
if (data.success) { if (data.success) {
$("#change_email_title").html("Please verify your new email"); $("#change_email_title").html("${_('Please verify your new email')}");
$("#change_email_form").html("<p>You'll receive a confirmation in your " + $("#change_email_form").html("<p>${_(('You\'ll receive a confirmation in your in-box.'
"in-box. Please click the link in the " + ' Please click the link in the email to confirm'
"email to confirm the email change.</p>"); ' the email change.'))}</p>");
$("#change_email_form").html("<p>${_('You\'ll receive a confirmation in your in-box. Please click the link in the email to confirm the email change.')}</p>");
} else { } else {
$("#change_email_error").html(data.error).stop().css("display", "block"); $("#change_email_error").html(data.error).stop().css("display", "block");
} }
...@@ -77,7 +76,6 @@ ...@@ -77,7 +76,6 @@
function(data) { function(data) {
if(data.success) { if(data.success) {
location.reload(); location.reload();
// $("#change_name_body").html("<p>Name changed.</p>");
} else { } else {
$("#change_name_error").html(data.error).stop().css("display", "block"); $("#change_name_error").html(data.error).stop().css("display", "block");
} }
......
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