mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
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:
parent
97f5a9565f
commit
3da5f05f75
1 changed files with 10 additions and 7 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue