diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index fb756f41..2cf58ff8 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -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(); + } } }