Skip to content

Commit 13daa55

Browse files
committed
Transitions: Remove uses of $.mobile.pageContainer
1 parent 63d7882 commit 13daa55

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

demos/pages/samepagetransition.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1>same page transitions</h1>
3333

3434
<div role="main" class="ui-content">
3535
<h1>same page transitions</h1>
36-
<div>All links within this page navigate to the page itself having the <code>allowSamePageTransition</code> option at the <code>$.mobile.pageContainer.pagecontainer( "change" )</code> method set to <strong>true</strong>. It seems, just the slide transition raises an issue so the page gets hidden.
36+
<div>All links within this page navigate to the page itself having the <code>allowSamePageTransition</code> option at the <code>.pagecontainer( "change" )</code> method set to <strong>true</strong>. It seems, just the slide transition raises an issue so the page gets hidden.
3737
<label><input type="checkbox" id="cb1" data-theme="b"> reverse transition </label>
3838
<label><input type="checkbox" id="cb2" data-theme="b"> add ui-page-active on pageshow </label>
3939
</div>
@@ -59,7 +59,7 @@ <h1>same page transitions</h1>
5959
var trans = $(this).text() || 'none',
6060
rev = !!$('#cb1').attr('checked');
6161

62-
$.mobile.pageContainer.pagecontainer( "change", "#page1", {
62+
$( this ).closest( ".ui-pagecontainer" ).pagecontainer( "change", "#page1", {
6363
transition: trans,
6464
allowSamePageTransition: true,
6565
reverse: rev

js/transitions/transition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ $.extend( $.mobile.Transition.prototype, {
150150
},
151151

152152
toggleViewportClass: function() {
153-
$.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + this.name );
153+
this.$to.closest( ".ui-pagecontainer" ).toggleClass( "ui-mobile-viewport-transitioning viewport-" + this.name );
154154
},
155155

156156
transition: function( toScroll ) {

tests/integration/transitions/transitions_core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ asyncTest( "change() applies perspective class to mobile viewport for flip", fun
102102

103103
$.testHelper.pageSequence( [
104104
function() {
105-
$.mobile.pageContainer.pagecontainer( "change", "#foo" );
105+
$( ".ui-pagecontainer" ).pagecontainer( "change", "#foo" );
106106
},
107107

108108
function() {
@@ -120,7 +120,7 @@ asyncTest( "change() applies transition class to mobile viewport for default tra
120120
expect( 1 );
121121
$.testHelper.pageSequence( [
122122
function() {
123-
$.mobile.pageContainer.pagecontainer( "change", "#baz" );
123+
$( ".ui-pagecontainer" ).pagecontainer( "change", "#baz" );
124124
},
125125

126126
function() {
@@ -165,8 +165,8 @@ asyncTest( "change() queues requests", function() {
165165
var firstPage = $( "#foo" ),
166166
secondPage = $( "#bar" );
167167

168-
$.mobile.pageContainer.pagecontainer( "change", firstPage );
169-
$.mobile.pageContainer.pagecontainer( "change", secondPage );
168+
$( ".ui-pagecontainer" ).pagecontainer( "change", firstPage );
169+
$( ".ui-pagecontainer" ).pagecontainer( "change", secondPage );
170170

171171
onToComplete( function() {
172172
ok( isTransitioningIn( firstPage ), "first page begins transition" );
@@ -204,7 +204,7 @@ function testTransitionMaxWidth( val, expected ) {
204204
start();
205205
}, 5000 );
206206

207-
$.mobile.pageContainer.pagecontainer( "change", $( ".ui-page:not(.ui-page-active)" ).first() );
207+
$( ".ui-pagecontainer" ).pagecontainer( "change", $( ".ui-page:not(.ui-page-active)" ).first() );
208208

209209
}
210210

0 commit comments

Comments
 (0)