Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit f25e73e

Browse files
committed
Demos: Remove uses of $.mobile.pageContainer
1 parent 619b651 commit f25e73e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

demos/backbone-requirejs/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
<h2>jQuery Mobile configuration</h2>
4444

45-
<p>The technique used in this <a href="backbone-require.html" rel="external">example page</a> is by no means the only technique available, but it is one of the most elegant. The Backbone.js router is used exclusively to handle all hashchange events, and the jQuery Mobile <code>$.mobile.pageContainer.pagecontainer( "change", url, options )</code> method is used to programmatically change the page.</p>
45+
<p>The technique used in this <a href="backbone-require.html" rel="external">example page</a> is by no means the only technique available, but it is one of the most elegant. The Backbone.js router is used exclusively to handle all hashchange events, and the jQuery Mobile <code>.pagecontainer( "change", url, options )</code> method is used to programmatically change the page.</p>
4646

4747
<p>Below are two internal jQuery Mobile properties that are turned off to allow this to happen:</p>
4848

@@ -115,7 +115,7 @@
115115
} );
116116
</code>
117117
</pre>
118-
<p>Next, inside of the Backbone.js Router class object, we can respond to haschange events and manually call the <code>$.mobile.pageContainer.pagecontainer( "change" )</code> method. Below is a small snippet of <strong>mobileRouter.js</strong>.</p>
118+
<p>Next, inside of the Backbone.js Router class object, we can respond to haschange events and manually call the <code>pagecontainer( "change" )</code> method. Below is a small snippet of <strong>mobileRouter.js</strong>.</p>
119119
<pre>
120120
<code>
121121
// Backbone.js Routes
@@ -133,7 +133,7 @@
133133
home: function() {
134134

135135
// Programatically changes to the categories page
136-
$.mobile.pageContainer.pagecontainer( "change", "#categories" , {
136+
$( ".ui-pagecontainer" ).pagecontainer( "change", "#categories" , {
137137
reverse: false,
138138
changeHash: false
139139
});

demos/backbone-requirejs/js/routers/mobileRouter.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ define([
1616
// The Router constructor
1717
initialize: function() {
1818

19+
this.pagecontainer = $( ".ui-pagecontainer" ).pagecontainer( "instance" );
20+
1921
// Instantiates a new Animal Category View
2022
this.animalsView = new CategoryView( { el: "#animals", collection: new CategoriesCollection( [] , { type: "animals" } ) } );
2123

@@ -45,7 +47,7 @@ define([
4547
home: function() {
4648

4749
// Programatically changes to the categories page
48-
$.mobile.pageContainer.pagecontainer( "change", "#categories", {
50+
this.pagecontainer.change( "#categories", {
4951
reverse: false,
5052
changeHash: false
5153
});
@@ -68,11 +70,10 @@ define([
6870
currentView.collection.fetch().done( function() {
6971

7072
// Programatically changes to the current categories page
71-
$.mobile.pageContainer.pagecontainer( "change", "#" + type, {
73+
this.pagecontainer.change( "#" + type, {
7274
reverse: false,
7375
changeHash: false
7476
});
75-
7677
} );
7778

7879
}
@@ -81,7 +82,7 @@ define([
8182
else {
8283

8384
// Programatically changes to the current categories page
84-
$.mobile.pageContainer.pagecontainer( "change", "#" + type, {
85+
this.pagecontainer.change( "#" + type, {
8586
reverse: false,
8687
changeHash: false
8788
});

0 commit comments

Comments
 (0)