Skip to content
This repository
Browse code

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...
commit 9b0bf5252d36fab398d76b3adc61a80a16b0a49f 1 parent e7a33db
Kin Blas jblas authored
6 docs/pages/dynamic-samples/sample-reuse-page-external.html
@@ -74,9 +74,9 @@
74 74 }
75 75
76 76
77   -// Listen for any attempts to call changepage.
  77 +// Listen for any attempts to call changePage().
78 78 $(document).bind( "pagebeforechange", function( e, data ) {
79   - // We only want to handle changepage calls where the caller is
  79 + // We only want to handle changePage() calls where the caller is
80 80 // asking us to load a page by URL.
81 81 if ( typeof data.toPage === "string" ) {
82 82 // We are being asked to load a page by URL, but we only
@@ -89,7 +89,7 @@
89 89 // on the fly based on our in-memory category data structure.
90 90 showCategory( u.href, data.options );
91 91
92   - // Make sure to tell changepage we've handled this call so it doesn't
  92 + // Make sure to tell changePage() we've handled this call so it doesn't
93 93 // have to do anything.
94 94 e.preventDefault();
95 95 }
6 docs/pages/dynamic-samples/sample-reuse-page.html
@@ -148,9 +148,9 @@
148 148 }
149 149
150 150
151   -// Listen for any attempts to call changepage.
  151 +// Listen for any attempts to call changePage().
152 152 $(document).bind( "pagebeforechange", function( e, data ) {
153   - // We only want to handle changepage calls where the caller is
  153 + // We only want to handle changePage() calls where the caller is
154 154 // asking us to load a page by URL.
155 155 if ( typeof data.toPage === "string" ) {
156 156 // We are being asked to load a page by URL, but we only
@@ -164,7 +164,7 @@
164 164 // on the fly based on our in-memory category data structure.
165 165 showCategory( u, data.options );
166 166
167   - // Make sure to tell changepage we've handled this call so it doesn't
  167 + // Make sure to tell changePage() we've handled this call so it doesn't
168 168 // have to do anything.
169 169 e.preventDefault();
170 170 }
6 docs/pages/page-dynamic.html
@@ -124,10 +124,10 @@
124 124 <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>
125 125 <pre>
126 126 <code>
127   -// Listen for any attempts to call changepage.
  127 +// Listen for any attempts to call changePage().
128 128 $(document).bind( &quot;pagebeforechange&quot;, function( e, data ) {
129 129
130   - // We only want to handle changepage calls where the caller is
  130 + // We only want to handle changePage() calls where the caller is
131 131 // asking us to load a page by URL.
132 132 if ( typeof data.toPage === &quot;string&quot; ) {
133 133
@@ -144,7 +144,7 @@
144 144 // on the fly based on our in-memory category data structure.
145 145 showCategory( u, data.options );
146 146
147   - // Make sure to tell changepage we've handled this call so it doesn't
  147 + // Make sure to tell changePage() we've handled this call so it doesn't
148 148 // have to do anything.
149 149 e.preventDefault();
150 150 }
13 js/jquery.mobile.navigation.js
@@ -428,8 +428,8 @@
428 428 })( true );
429 429
430 430 // to get last scroll, we need to get scrolltop before the page change
431   - // using beforechangepage or popstate/hashchange (whichever comes first)
432   - $( document ).bind( "beforechangepage", getLastScroll );
  431 + // using pagebeforechange or popstate/hashchange (whichever comes first)
  432 + $( document ).bind( "pagebeforechange", getLastScroll );
433 433 $( window ).bind( $.support.pushState ? "popstate" : "hashchange", getLastScroll );
434 434
435 435 // Make the iOS clock quick-scroll work again if we're using native overflow scrolling
@@ -877,8 +877,6 @@
877 877 // Let listeners know we're about to change the current page.
878 878 mpc.trigger( pbcEvent, triggerData );
879 879
880   - mpc.trigger( "beforechangepage", triggerData ); // XXX: DEPRECATED for 1.0
881   -
882 880 // If the default behavior is prevented, stop here!
883 881 if( pbcEvent.isDefaultPrevented() ){
884 882 return;
@@ -907,7 +905,6 @@
907 905 $.mobile.changePage( newPage, options );
908 906 })
909 907 .fail(function( url, options ) {
910   - // XXX_jblas: Fire off changepagefailed notificaiton.
911 908 isPageTransitioning = false;
912 909
913 910 //clear out the active button state
@@ -916,7 +913,6 @@
916 913 //release transition lock so navigation is free again
917 914 releasePageTransitionLock();
918 915 settings.pageContainer.trigger( "pagechangefailed", triggerData );
919   - settings.pageContainer.trigger( "changepagefailed", triggerData ); // XXX: DEPRECATED for 1.0
920 916 });
921 917 return;
922 918 }
@@ -943,7 +939,6 @@
943 939 if( fromPage && fromPage[0] === toPage[0] ) {
944 940 isPageTransitioning = false;
945 941 mpc.trigger( "pagechange", triggerData );
946   - mpc.trigger( "changepage", triggerData ); // XXX: DEPRECATED for 1.0
947 942 return;
948 943 }
949 944
@@ -1031,8 +1026,6 @@
1031 1026
1032 1027 // Let listeners know we're all done changing the current page.
1033 1028 mpc.trigger( "pagechange", triggerData );
1034   -
1035   - mpc.trigger( "changepage", triggerData ); // XXX: DEPRECATED for 1.0
1036 1029 });
1037 1030 };
1038 1031
@@ -1289,7 +1282,7 @@
1289 1282 isForward: function() { window.history.forward(); }
1290 1283 });
1291 1284
1292   - // prevent changepage
  1285 + // prevent changePage()
1293 1286 return;
1294 1287 } else {
1295 1288 // if the current active page is a dialog and we're navigating
4 tests/jquery.testHelper.js
@@ -88,7 +88,7 @@
88 88 },
89 89
90 90 pageSequence: function(fns){
91   - this.eventSequence("changepage", fns);
  91 + this.eventSequence("pagechange", fns);
92 92 },
93 93
94 94 eventSequence: function(event, fns, timedOut){
@@ -97,7 +97,7 @@
97 97
98 98 if( fn === undefined ) return;
99 99
100   - // if a changepage or defined event is never triggered
  100 + // if a pagechange or defined event is never triggered
101 101 // continue in the sequence to alert possible failures
102 102 var warnTimer = setTimeout(function(){
103 103 self.eventSequence(event, fns, true);
2  tests/unit/navigation/navigation_base.js
@@ -9,7 +9,7 @@
9 9 setup: function(){
10 10 if ( location.hash ) {
11 11 stop();
12   - $(document).one("changepage", function() {
  12 + $(document).one("pagechange", function() {
13 13 start();
14 14 } );
15 15 location.hash = "";
4 tests/unit/navigation/navigation_core.js
@@ -21,7 +21,7 @@
21 21
22 22 stop();
23 23
24   - $(document).one( "changepage", function() {
  24 + $(document).one( "pagechange", function() {
25 25 start();
26 26 });
27 27
@@ -197,7 +197,7 @@
197 197 }], 1000);
198 198 });
199 199
200   - asyncTest( "forms with data attribute ajax not set or set to anything but false will call changepage", function(){
  200 + asyncTest( "forms with data attribute ajax not set or set to anything but false will call changePage", function(){
201 201 var called = 0,
202 202 newChangePage = function(){
203 203 called++;
2  tests/unit/navigation/navigation_helpers.js
@@ -8,7 +8,7 @@
8 8 setup: function(){
9 9 if ( location.hash ) {
10 10 stop();
11   - $(document).one("changepage", function() {
  11 + $(document).one("pagechange", function() {
12 12 start();
13 13 } );
14 14 location.hash = "";

0 comments on commit 9b0bf52

Please sign in to comment.
Something went wrong with that request. Please try again.