Permalink
Browse files

Fix for issue 1826 - Nightly build - dialog box no longer rounded cor…

…ners

- Don't set a default value for the 'role' option to loadPage() and changePage(). Instead, rely on the role attribute that is on the element.

- Fixed an error that was happening when a hash change involves going from a dialog back to another dialog. I had recently made changes that assumed the 'to' variable was always going to be a url string, but it turns out in the dialog back to dialog case, it is an actual jQuery collection.
  • Loading branch information...
1 parent d2f1153 commit 8b6d14bb0386e11dd6860de80fe7243f920d45c4 @jblas jblas committed Jun 16, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 js/jquery.mobile.navigation.js
@@ -671,7 +671,7 @@
type: "get",
data: undefined,
reloadPage: false,
- role: "page",
+ role: undefined, // By default we rely on the role defined by the @data-role attribute.
showLoadMsg: true,
pageContainer: undefined
};
@@ -780,7 +780,7 @@
//
// XXX_jblas: We need to remove this at some point when we allow for transitions
// to the same page.
- if( active && active.page[0] === toPage[0] ) {
+ if( fromPage && fromPage[0] === toPage[0] ) {
isPageTransitioning = false;
mpc.trigger( "changepage" );
return;
@@ -870,7 +870,7 @@
reverse: false,
changeHash: true,
fromHashChange: false,
- role: "page",
+ role: undefined, // By default we rely on the role defined by the @data-role attribute.
duplicateCachedPage: undefined,
pageContainer: undefined
};
@@ -1022,7 +1022,7 @@
$link.jqmData( "back" ),
//this may need to be more specific as we use data-rel more
- role = $link.attr( "data-" + $.mobile.ns + "rel" ) || "page";
+ role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined;
$.mobile.changePage( href, { transition: transition, reverse: reverse, role: role } );
event.preventDefault();
@@ -1068,7 +1068,8 @@
//if to is defined, load it
if ( to ) {
- $.mobile.changePage( ( path.isPath(to) ? "" : "#" ) + to, { transition: transition, changeHash: false, fromHashChange: true } );
+ to = ( typeof to === "string" && !path.isPath( to ) ) ? ( '#' + to ) : to;
+ $.mobile.changePage( to, { transition: transition, changeHash: false, fromHashChange: true } );
}
//there's no hash, go to the first page in the dom
else {

0 comments on commit 8b6d14b

Please sign in to comment.