mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Merge branch 'master' of https://github.com/jquery/jquery-mobile into fr_1177
* 'master' of https://github.com/jquery/jquery-mobile: [astounding] fixed css that locked ie in the navigation unit tests. tagged so I can show my kids some day Fix for issues: set version to 1.0a4.1 wrapped the else if/else in an else to prevent an unnecessary dom walk until we have to make it. To ensure focus and scrollTo don't conflict (when possible), I set the focus order on page show to 1) previously clicked item if revisiting that page 2) page title 3) first focusable item in the page. Fixes #1342
This commit is contained in:
commit
dbdb6c5716
5 changed files with 26 additions and 29 deletions
|
|
@ -33,9 +33,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
|
||||
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
@ -75,9 +75,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
|
||||
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
|||
14
external/qunit.css
vendored
14
external/qunit.css
vendored
|
|
@ -11,11 +11,10 @@
|
|||
/** Resets */
|
||||
|
||||
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
|
||||
margin: 0;
|
||||
margin: 0 8px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/** Header */
|
||||
|
||||
#qunit-header {
|
||||
|
|
@ -32,6 +31,8 @@
|
|||
-moz-border-radius: 15px 15px 0 0;
|
||||
-webkit-border-top-right-radius: 15px;
|
||||
-webkit-border-top-left-radius: 15px;
|
||||
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
#qunit-header a {
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
|
||||
#qunit-tests {
|
||||
list-style-position: inside;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
#qunit-tests li {
|
||||
|
|
@ -195,13 +197,7 @@
|
|||
left: -10000px;
|
||||
}
|
||||
|
||||
[ data-nstest-role='page'], [ data-nstest-role='dialog'] {
|
||||
[data-nstest-role='page'], [data-nstest-role='dialog'] {
|
||||
position: absolute !important;
|
||||
top: -10000px !important;
|
||||
}
|
||||
|
||||
/* maintain styling */
|
||||
.ui-mobile-viewport {
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -237,12 +237,20 @@
|
|||
|
||||
//direct focus to the page title, or otherwise first focusable element
|
||||
function reFocus( page ){
|
||||
var pageTitle = page.find( ".ui-title:eq(0)" );
|
||||
if( pageTitle.length ){
|
||||
pageTitle.focus();
|
||||
var lastClicked = page.jqmData( "lastClicked" );
|
||||
|
||||
if( lastClicked && lastClicked.length ){
|
||||
lastClicked.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -396,7 +404,9 @@
|
|||
|
||||
if( from ){
|
||||
//set as data for returning to that spot
|
||||
from.jqmData( "lastScroll", currScroll);
|
||||
from
|
||||
.jqmData( "lastScroll", currScroll)
|
||||
.jqmData( "lastClicked", $activeClickedLink);
|
||||
//trigger before show/hide events
|
||||
from.data( "page" )._trigger( "beforehide", null, { nextPage: to } );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,12 +30,9 @@ var dataPropertyName = "virtualMouseBindings",
|
|||
resetTimerID = 0,
|
||||
startX = 0,
|
||||
startY = 0,
|
||||
startScrollX = 0,
|
||||
startScrollY = 0,
|
||||
didScroll = false,
|
||||
clickBlockList = [],
|
||||
blockMouseTriggers = false,
|
||||
scrollTopSupported = $.support.scrollTop,
|
||||
eventCaptureSupported = $.support.eventCapture,
|
||||
$document = $(document),
|
||||
nextTouchID = 1,
|
||||
|
|
@ -227,11 +224,6 @@ function handleTouchStart(event)
|
|||
startX = t.pageX;
|
||||
startY = t.pageY;
|
||||
|
||||
if (scrollTopSupported){
|
||||
startScrollX = window.pageXOffset;
|
||||
startScrollY = window.pageYOffset;
|
||||
}
|
||||
|
||||
triggerVirtualEvent("vmouseover", event, flags);
|
||||
triggerVirtualEvent("vmousedown", event, flags);
|
||||
}
|
||||
|
|
@ -255,7 +247,6 @@ function handleTouchMove(event)
|
|||
var didCancel = didScroll,
|
||||
moveThreshold = $.vmouse.moveDistanceThreshold;
|
||||
didScroll = didScroll
|
||||
|| (scrollTopSupported && (startScrollX !== window.pageXOffset || startScrollY !== window.pageYOffset))
|
||||
|| (Math.abs(t.pageX - startX) > moveThreshold || Math.abs(t.pageY - startY) > moveThreshold);
|
||||
|
||||
var flags = getVirtualBindingFlags(event.target);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.0beta-pre
|
||||
1.0a4.1
|
||||
Loading…
Reference in a new issue