mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-13 10:51:02 +00:00
focus on title or page div
This commit is contained in:
parent
ebafc02cfe
commit
97539ed3bd
1 changed files with 5 additions and 12 deletions
|
|
@ -354,20 +354,13 @@
|
|||
|
||||
//direct focus to the page title, or otherwise first focusable element
|
||||
function reFocus( page ) {
|
||||
var lastClicked = page.jqmData( "lastClicked" );
|
||||
var pageTitle = page.find( ".ui-title:eq(0)" );
|
||||
|
||||
if( lastClicked && lastClicked.length ) {
|
||||
lastClicked.focus();
|
||||
if( pageTitle.length ) {
|
||||
pageTitle.focus();
|
||||
}
|
||||
else {
|
||||
var pageTitle = page.find( ".ui-title:eq(0)" );
|
||||
|
||||
if( pageTitle.length ) {
|
||||
pageTitle.focus();
|
||||
}
|
||||
else{
|
||||
page.find( focusable ).eq( 0 ).focus();
|
||||
}
|
||||
else{
|
||||
page.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue