diff --git a/docs/api/globalconfig.html b/docs/api/globalconfig.html
index e09fcbbe..6c3bbab8 100755
--- a/docs/api/globalconfig.html
+++ b/docs/api/globalconfig.html
@@ -92,7 +92,7 @@ $(document).bind("mobileinit", function(){
The class assigned to page currently in view, and during transitions
- activeBtnClass string, default: "ui-page-active"
+ activeBtnClass string, default: "ui-btn-active"
The class used for "active" button state, from CSS framework.
ajaxEnabled boolean, default: true
diff --git a/docs/forms/forms-sample-response.php b/docs/forms/forms-sample-response.php
index fe0e7224..dfbdbe0c 100755
--- a/docs/forms/forms-sample-response.php
+++ b/docs/forms/forms-sample-response.php
@@ -27,12 +27,15 @@
You Chose:
-
+
" . $_REQUEST['shipping'] . "";
?>
-
+
+
+
+ Change shipping method
diff --git a/docs/forms/forms-sample.html b/docs/forms/forms-sample.html
index fee85b17..ce964e87 100755
--- a/docs/forms/forms-sample.html
+++ b/docs/forms/forms-sample.html
@@ -27,17 +27,14 @@
In jQuery Mobile, form submissions are automatically handled using Ajax whenever possible, creating a smooth transition between the form and the result page. To ensure your form submits as intended, be sure to specify action and method properties on your form element. When unspecified, the method will default to get, and the action will default to the current page's relative path (found via $.mobile.path.get()
Forms also accept attributes for transitions just like anchors, such as data-transition="pop" and data-direction="reverse". To submit a form without Ajax, you can either disable Ajax form handling globally, or per form via the data-ajax="false" attribute. The target attribute (as in target="_blank") is respected on forms as well, and will default to the browser's handling of that target when the form submits. Note that unlike anchors, the rel attribute is not allowed on forms.
-
- Non-Ajax handling
-
- To prevent form submissions from being automatically handled with Ajax, add the data-ajax="false" attribute to the form element. You can also turn of Ajax form handling completely via the ajaxEnabled global config option.
+
- Simple Ajax form example
- This page demonstrates automated ajax handling of form submissions. The form below is configured to send regular a get request to forms-sample-response.php. On submit, jQuery Mobile will make sure that the Url specified is able to be retrieved via Ajax, and handle it appropriately. Keep in mind that just like ordinary HTTP form submissions, jQuery Mobile allows get result pages to be bookmarked by updating the Url hash when the response returns successfully. Also like ordinary form submissions, post requests do not contain query parameters in the hash, so they are not bookmarkable.
-
+
+ Non-Ajax form example
+
+ To prevent form submissions from being automatically handled with Ajax, add the data-ajax="false" attribute to the form element. You can also turn of Ajax form handling completely via the ajaxEnabled global config option.
+
+ The form below is identical to the one above except for the addition of the data-ajax="false" attribute attribute. When the submit button is pressed, it will result in a full page refresh.
+
diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js
old mode 100644
new mode 100755
index adf64fcb..bce278f9
--- a/js/jquery.mobile.navigation.js
+++ b/js/jquery.mobile.navigation.js
@@ -832,17 +832,39 @@
return;
}
+ var settings = $.extend( {}, $.mobile.changePage.defaults, options );
+
+ // Make sure we have a pageContainer to work with.
+ settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
+
+ // Make sure we have a fromPage.
+ settings.fromPage = settings.fromPage || $.mobile.activePage;
+
+ var mpc = settings.pageContainer,
+ pbcEvent = new $.Event( "pagebeforechange" ),
+ triggerData = { toPage: toPage, options: settings };
+
+ // Let listeners know we're about to change the current page.
+ mpc.trigger( pbcEvent, triggerData );
+
+ mpc.trigger( "beforechangepage", triggerData ); // XXX: DEPRECATED for 1.0
+
+ // If the default behavior is prevented, stop here!
+ if( pbcEvent.isDefaultPrevented() ){
+ return;
+ }
+
+ // We allow "pagebeforechange" observers to modify the toPage in the trigger
+ // data to allow for redirects. Make sure our toPage is updated.
+
+ toPage = triggerData.toPage;
+
// Set the isPageTransitioning flag to prevent any requests from
// entering this method while we are in the midst of loading a page
// or transitioning.
isPageTransitioning = true;
- var settings = $.extend( {}, $.mobile.changePage.defaults, options );
-
- // Make sure we have a pageContainer to work with.
- settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
-
// If the caller passed us a url, call loadPage()
// to make sure it is loaded into the DOM. We'll listen
// to the promise object it returns so we know when
@@ -863,16 +885,16 @@
//release transition lock so navigation is free again
releasePageTransitionLock();
- settings.pageContainer.trigger("changepagefailed");
+ settings.pageContainer.trigger( "pagechangefailed", triggerData );
+ settings.pageContainer.trigger( "changepagefailed", triggerData ); // XXX: DEPRECATED for 1.0
});
return;
}
// The caller passed us a real page DOM element. Update our
// internal state and then trigger a transition to the page.
- var mpc = settings.pageContainer,
- fromPage = $.mobile.activePage,
- url = toPage.jqmData( "url" ),
+ var fromPage = settings.fromPage,
+ url = ( settings.dataUrl && path.convertUrlToDataUrl( settings.dataUrl ) ) || toPage.jqmData( "url" ),
// The pageUrl var is usually the same as url, except when url is obscured as a dialog url. pageUrl always contains the file path
pageUrl = url,
fileUrl = path.getFilePath( url ),
@@ -882,9 +904,6 @@
pageTitle = document.title,
isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog";
- // Let listeners know we're about to change the current page.
- mpc.trigger( "beforechangepage" );
-
// If we are trying to transition to the same page that we are currently on ignore the request.
// an illegal same page request is defined by the current page being the same as the url, as long as there's history
// and toPage is not an array or object (those are allowed to be "same")
@@ -893,7 +912,8 @@
// to the same page.
if( fromPage && fromPage[0] === toPage[0] ) {
isPageTransitioning = false;
- mpc.trigger( "changepage" );
+ mpc.trigger( "pagechange", triggerData );
+ mpc.trigger( "changepage", triggerData ); // XXX: DEPRECATED for 1.0
return;
}
@@ -980,7 +1000,9 @@
releasePageTransitionLock();
// Let listeners know we're all done changing the current page.
- mpc.trigger( "changepage" );
+ mpc.trigger( "pagechange", triggerData );
+
+ mpc.trigger( "changepage", triggerData ); // XXX: DEPRECATED for 1.0
});
};
@@ -992,7 +1014,9 @@
role: undefined, // By default we rely on the role defined by the @data-role attribute.
duplicateCachedPage: undefined,
pageContainer: undefined,
- showLoadMsg: true //loading message shows by default when pages are being fetched during changePage
+ showLoadMsg: true, //loading message shows by default when pages are being fetched during changePage
+ dataUrl: undefined,
+ fromPage: undefined
};
/* Event Bindings - hashchange, submit, and click */