Removed support for the alpha signature of $.mobile.changePage() in preparation for jQM 1.0. Folks now how to use the signature that requires the toPage (url or element) as the first arg, and options object as the 2nd.

This commit is contained in:
Kin Blas 2011-09-20 15:40:52 -07:00
parent dd458d1d4e
commit 14bafc510d

View file

@ -862,43 +862,6 @@
// Show a specific page in the page container.
$.mobile.changePage = function( toPage, options ) {
// XXX: REMOVE_BEFORE_SHIPPING_1.0
// This is temporary code that makes changePage() compatible with previous alpha versions.
if ( typeof options !== "object" ) {
var opts = null;
// Map old-style call signature for form submit to the new options object format.
if ( typeof toPage === "object" && toPage.url && toPage.type ) {
opts = {
type: toPage.type,
data: toPage.data,
forcePageLoad: true
};
toPage = toPage.url;
}
// The arguments passed into the function need to be re-mapped
// to the new options object format.
var len = arguments.length;
if ( len > 1 ) {
var argNames = [ "transition", "reverse", "changeHash", "fromHashChange" ], i;
for ( i = 1; i < len; i++ ) {
var a = arguments[ i ];
if ( typeof a !== "undefined" ) {
opts = opts || {};
opts[ argNames[ i - 1 ] ] = a;
}
}
}
// If an options object was created, then we know changePage() was called
// with an old signature.
if ( opts ) {
return $.mobile.changePage( toPage, opts );
}
}
// XXX: REMOVE_BEFORE_SHIPPING_1.0
// If we are in the midst of a transition, queue the current request.
// We'll call changePage() once we're done with the current transition to
// service the request.