diff --git a/lms/static/js/toggle_login_modal.js b/lms/static/js/toggle_login_modal.js index df62a01505..063da6998e 100644 --- a/lms/static/js/toggle_login_modal.js +++ b/lms/static/js/toggle_login_modal.js @@ -87,17 +87,19 @@ } }); - $("a[rel*=leanModal]").each(function(){ - $(this).leanModal({ top : 120, overlay: 1, closeButton: ".close-modal", position: 'absolute' }); - embed = $($(this).attr('href')).find('iframe') - if(embed.length > 0) { - if(embed.attr('src').indexOf("?") > 0) { - embed.data('src', embed.attr('src') + '&autoplay=1&rel=0'); - embed.attr('src', ''); - } else { - embed.data('src', embed.attr('src') + '?autoplay=1&rel=0'); - embed.attr('src', ''); - } - } + $(document).ready(function($) { + $("a[rel*=leanModal]").each(function(){ + $(this).leanModal({ top : 120, overlay: 1, closeButton: ".close-modal", position: 'absolute' }); + embed = $($(this).attr('href')).find('iframe') + if(embed.length > 0) { + if(embed.attr('src').indexOf("?") > 0) { + embed.data('src', embed.attr('src') + '&autoplay=1&rel=0'); + embed.attr('src', ''); + } else { + embed.data('src', embed.attr('src') + '?autoplay=1&rel=0'); + embed.attr('src', ''); + } + } + }); }); })(jQuery); diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 811354e758..e2ae7ca042 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -35,7 +35,7 @@ $("#unenroll_course_id").val() + "&enrollment_action=unenroll"; } else { $('#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"); } }); @@ -56,11 +56,10 @@ {"new_email" : new_email, "password" : new_password}, function(data) { if (data.success) { - $("#change_email_title").html("Please verify your new email"); - $("#change_email_form").html("
You'll receive a confirmation in your " + - "in-box. Please click the link in the " + - "email to confirm the email change.
"); - $("#change_email_form").html("${_('You\'ll receive a confirmation in your in-box. Please click the link in the email to confirm the email change.')}
"); + $("#change_email_title").html("${_('Please verify your new email')}"); + $("#change_email_form").html("${_(('You\'ll receive a confirmation in your in-box.' + ' Please click the link in the email to confirm' + ' the email change.'))}
"); } else { $("#change_email_error").html(data.error).stop().css("display", "block"); } @@ -77,7 +76,6 @@ function(data) { if(data.success) { location.reload(); - // $("#change_name_body").html("Name changed.
"); } else { $("#change_name_error").html(data.error).stop().css("display", "block"); }