wrapped the else if/else in an else to prevent an unnecessary dom walk until we have to make it.

This commit is contained in:
scottjehl 2011-04-07 16:50:10 -04:00
parent 97f5a9565f
commit 3da5f05f75

View file

@ -237,17 +237,20 @@
//direct focus to the page title, or otherwise first focusable element
function reFocus( page ){
var pageTitle = page.find( ".ui-title:eq(0)" ),
lastClicked = page.jqmData( "lastClicked" );
var lastClicked = page.jqmData( "lastClicked" );
if( lastClicked && lastClicked.length ){
lastClicked.focus();
}
else if( pageTitle.length ){
pageTitle.focus();
}
else{
page.find( focusable ).eq(0).focus();
else {
var pageTitle = page.find( ".ui-title:eq(0)" );
if( pageTitle.length ){
pageTitle.focus();
}
else{
page.find( focusable ).eq(0).focus();
}
}
}