Fix 'Uncaught ReferenceError: jQuery is not defined' if jQuery is not included in template.

This commit is contained in:
Tim Snadden 2014-04-30 09:12:23 +12:00
parent ff42ad268e
commit afad65ee71

View File

@ -124,7 +124,7 @@ class MemberLoginForm extends LoginForm {
$js = <<<JS
(function() {
var el = document.getElementById("MemberLoginForm_LoginForm_Email");
if(el && el.focus && (!jQuery || jQuery(el).is(':visible'))) el.focus();
if(el && el.focus && (typeof jQuery == 'undefined' || jQuery(el).is(':visible'))) el.focus();
})();
JS;
Requirements::customScript($js, 'MemberLoginFormFieldFocus');