Commit c13f3bbc authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Cater for no element requiring focusing

parent 650d0306
......@@ -53,7 +53,11 @@ function processingStop() {
// Autofocus the first element with a class of 'autofocus' on page load
addLoadEvent(function() {
getFirstElementByTagAndClassName(null, 'autofocus', document.body).focus();
var element = getFirstElementByTagAndClassName(null, 'autofocus', document.body)
if ( element && typeof(element.focus) == 'function' ) {
// @todo remove this when we migrate to mochikit 1.4
Supports Markdown
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