Permalink
Browse files

Navigation: Remove $.mobile.loadPage()

  • Loading branch information...
gabrielschulhof authored and arschmitz committed Jan 28, 2015
1 parent 6ca700e commit 4d3850911bd30f00d616afad3e1b81569de6d77d
Showing with 7 additions and 23 deletions.
  1. +1 −1 demos/old-faq-pages/index.php
  2. +4 −20 js/navigation.js
  3. +2 −2 js/widgets/pagecontainer.js
@@ -9,7 +9,7 @@
<li data-role="list-divider">Pages</li>
<li data-section="Questions &amp; Answers" data-filtertext="head load scripts styles pageinit onload pagebeforecreate ajax nav pages"><a href="faq/scripts-and-styles-not-loading.php">Why aren't my scripts and styles loading?</a></li>
<li data-section="Questions &amp; Answers" data-filtertext="document.ready onload paginit DOM ready on ready scripts "><a href="faq/dom-ready-not-working.php">Why isn't DOM ready working for my scripts?</a></li>
<li data-section="Questions &amp; Answers" data-filtertext="ajax nav load page mobile.loadpage"><a href="faq/how-do-i-load-a-page.php">How do I load a page?</a></li>
<li data-section="Questions &amp; Answers" data-filtertext="ajax nav load page pagecontainer load"><a href="faq/how-do-i-load-a-page.php">How do I load a page?</a></li>
<li data-section="Questions &amp; Answers" data-filtertext="ajax nav multi page document load"><a href="faq/why-is-only-the-first-page-loaded.php">Why is only the first page of my multi page document loaded?</a></li>
<li data-section="Questions &amp; Answers" data-filtertext="pass url query params ajax nav"><a href="faq/pass-query-params-to-page.php">I'm trying to pass query params to a page but it's not working?</a></li>
<li data-section="Questions &amp; Answers" data-filtertext="hash pass parameters information ajax nav"><a href="faq/pass-via-the-hash-to-page.php">I'm trying to pass information via the hash but it's not working?</a></li>
View
@@ -74,25 +74,6 @@ function findClosestLink( ele ) {
return ele;
}
$.mobile.loadPage = function( url, opts ) {
var container;
opts = opts || {};
container = ( opts.pageContainer || $.mobile.pageContainer );
// create the deferred that will be supplied to loadPage callers
// and resolved by the content widget's load method
opts.deferred = $.Deferred();
// Preferring to allow exceptions for uninitialized opts.pageContainer
// widgets so we know if we need to force init here for users
container.pagecontainer( "load", url, opts );
// provide the deferred
return opts.deferred.promise();
};
//define vars for interal use
/* internal utility functions */
@@ -394,7 +375,10 @@ $.mobile._registerInternalEvents = function() {
if ( url && $.inArray( url, urls ) === -1 ) {
urls.push( url );
$.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ), prefetch: true } );
$.mobile.pageContainer.pagecontainer( "load", url, {
role: $link.attr( "data-" + $.mobile.ns + "rel" ),
prefetch: true
});
}
} );
} );
@@ -931,7 +931,7 @@ $.widget( "mobile.pagecontainer", {
triggerData.absUrl = $.mobile.path.makeUrlAbsolute( to, this._findBaseWithDefault() );
} else {
// If the toPage is a jQuery object grab the absolute url stored in the loadPage
// If the toPage is a jQuery object grab the absolute url stored in the load()
// callback where it exists
triggerData.absUrl = settings.absUrl;
}
@@ -973,7 +973,7 @@ $.widget( "mobile.pagecontainer", {
// string, because an object can also be replaced by a string
to = triggerData.toPage;
// If the caller passed us a url, call loadPage() to make sure it is loaded into the DOM.
// If the caller passed us a url, call load() to make sure it is loaded into the DOM.
// We'll listen to the promise object it returns so we know when it is done loading or if
// an error ocurred.
if ( $.type( to ) === "string" ) {

0 comments on commit 4d38509

Please sign in to comment.