Permalink
Browse files

Removed deprecated "beforechangepage", "changepage", and "changepagef…

…ailed" event references in preparation for jQM 1.0 release.

Updated the unit tests to use "pagechange" event instead of "changepage".
  • Loading branch information...
1 parent e7a33db commit 9b0bf5252d36fab398d76b3adc61a80a16b0a49f @jblas jblas committed Sep 20, 2011
@@ -74,9 +74,9 @@
}
-// Listen for any attempts to call changepage.
+// Listen for any attempts to call changePage().
$(document).bind( "pagebeforechange", function( e, data ) {
- // We only want to handle changepage calls where the caller is
+ // We only want to handle changePage() calls where the caller is
// asking us to load a page by URL.
if ( typeof data.toPage === "string" ) {
// We are being asked to load a page by URL, but we only
@@ -89,7 +89,7 @@
// on the fly based on our in-memory category data structure.
showCategory( u.href, data.options );
- // Make sure to tell changepage we've handled this call so it doesn't
+ // Make sure to tell changePage() we've handled this call so it doesn't
// have to do anything.
e.preventDefault();
}
@@ -148,9 +148,9 @@
}
-// Listen for any attempts to call changepage.
+// Listen for any attempts to call changePage().
$(document).bind( "pagebeforechange", function( e, data ) {
- // We only want to handle changepage calls where the caller is
+ // We only want to handle changePage() calls where the caller is
// asking us to load a page by URL.
if ( typeof data.toPage === "string" ) {
// We are being asked to load a page by URL, but we only
@@ -164,7 +164,7 @@
// on the fly based on our in-memory category data structure.
showCategory( u, data.options );
- // Make sure to tell changepage we've handled this call so it doesn't
+ // Make sure to tell changePage() we've handled this call so it doesn't
// have to do anything.
e.preventDefault();
}
@@ -124,10 +124,10 @@
<p>The application was able to insert itself into the changePage() flow by binding to the &quot;pagebeforechange&quot; event at the document level:</p>
<pre>
<code>
-// Listen for any attempts to call changepage.
+// Listen for any attempts to call changePage().
$(document).bind( &quot;pagebeforechange&quot;, function( e, data ) {
- // We only want to handle changepage calls where the caller is
+ // We only want to handle changePage() calls where the caller is
// asking us to load a page by URL.
if ( typeof data.toPage === &quot;string&quot; ) {
@@ -144,7 +144,7 @@
// on the fly based on our in-memory category data structure.
showCategory( u, data.options );
- // Make sure to tell changepage we've handled this call so it doesn't
+ // Make sure to tell changePage() we've handled this call so it doesn't
// have to do anything.
e.preventDefault();
}
@@ -428,8 +428,8 @@
})( true );
// to get last scroll, we need to get scrolltop before the page change
- // using beforechangepage or popstate/hashchange (whichever comes first)
- $( document ).bind( "beforechangepage", getLastScroll );
+ // using pagebeforechange or popstate/hashchange (whichever comes first)
+ $( document ).bind( "pagebeforechange", getLastScroll );
$( window ).bind( $.support.pushState ? "popstate" : "hashchange", getLastScroll );
// Make the iOS clock quick-scroll work again if we're using native overflow scrolling
@@ -877,8 +877,6 @@
// 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;
@@ -907,7 +905,6 @@
$.mobile.changePage( newPage, options );
})
.fail(function( url, options ) {
- // XXX_jblas: Fire off changepagefailed notificaiton.
isPageTransitioning = false;
//clear out the active button state
@@ -916,7 +913,6 @@
//release transition lock so navigation is free again
releasePageTransitionLock();
settings.pageContainer.trigger( "pagechangefailed", triggerData );
- settings.pageContainer.trigger( "changepagefailed", triggerData ); // XXX: DEPRECATED for 1.0
});
return;
}
@@ -943,7 +939,6 @@
if( fromPage && fromPage[0] === toPage[0] ) {
isPageTransitioning = false;
mpc.trigger( "pagechange", triggerData );
- mpc.trigger( "changepage", triggerData ); // XXX: DEPRECATED for 1.0
return;
}
@@ -1031,8 +1026,6 @@
// Let listeners know we're all done changing the current page.
mpc.trigger( "pagechange", triggerData );
-
- mpc.trigger( "changepage", triggerData ); // XXX: DEPRECATED for 1.0
});
};
@@ -1289,7 +1282,7 @@
isForward: function() { window.history.forward(); }
});
- // prevent changepage
+ // prevent changePage()
return;
} else {
// if the current active page is a dialog and we're navigating
@@ -88,7 +88,7 @@
},
pageSequence: function(fns){
- this.eventSequence("changepage", fns);
+ this.eventSequence("pagechange", fns);
},
eventSequence: function(event, fns, timedOut){
@@ -97,7 +97,7 @@
if( fn === undefined ) return;
- // if a changepage or defined event is never triggered
+ // if a pagechange or defined event is never triggered
// continue in the sequence to alert possible failures
var warnTimer = setTimeout(function(){
self.eventSequence(event, fns, true);
@@ -9,7 +9,7 @@
setup: function(){
if ( location.hash ) {
stop();
- $(document).one("changepage", function() {
+ $(document).one("pagechange", function() {
start();
} );
location.hash = "";
@@ -21,7 +21,7 @@
stop();
- $(document).one( "changepage", function() {
+ $(document).one( "pagechange", function() {
start();
});
@@ -197,7 +197,7 @@
}], 1000);
});
- asyncTest( "forms with data attribute ajax not set or set to anything but false will call changepage", function(){
+ asyncTest( "forms with data attribute ajax not set or set to anything but false will call changePage", function(){
var called = 0,
newChangePage = function(){
called++;
@@ -8,7 +8,7 @@
setup: function(){
if ( location.hash ) {
stop();
- $(document).one("changepage", function() {
+ $(document).one("pagechange", function() {
start();
} );
location.hash = "";

0 comments on commit 9b0bf52

Please sign in to comment.