Skip to content

Commit

Permalink
Pagecontainer: Remove reloadPage option
Browse files Browse the repository at this point in the history
  • Loading branch information
apsdehal committed Jun 7, 2016
1 parent ba595b4 commit a9a7089
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
12 changes: 1 addition & 11 deletions js/widgets/pagecontainer.js
Expand Up @@ -614,9 +614,6 @@ $.widget( "mobile.pagecontainer", {
type: "get",
data: undefined,

// DEPRECATED
reloadPage: false,

reload: false,

// By default we rely on the role defined by the @data-role attribute.
Expand All @@ -635,15 +632,8 @@ $.widget( "mobile.pagecontainer", {
// know when the content is done loading, or if an error has occurred.
var deferred = ( options && options.deferred ) || $.Deferred(),

// Examining the option "reloadPage" passed by the user is deprecated as of 1.4.0
// and will be removed in 1.5.0.
// Copy option "reloadPage" to "reload", but only if option "reload" is not present
reloadOptionExtension = ( ( options && options.reload === undefined &&
options.reloadPage !== undefined ) ?
{ reload: options.reloadPage } : {} ),

// The default load options with overrides specified by the caller.
settings = $.extend( {}, this._loadDefaults, options, reloadOptionExtension ),
settings = $.extend( {}, this._loadDefaults, options ),

// The DOM element for the content after it has been loaded.
content = null,
Expand Down
13 changes: 2 additions & 11 deletions tests/unit/pagecontainer/pagecontainer_core.js
Expand Up @@ -49,25 +49,16 @@ QUnit.test( "load does not trigger an error when called withput a second param",
assert.ok( "no error triggered when load method called without options" );
} );

QUnit.test( "Options 'reload' and 'reloadPage' both work, and 'reload' takes precedence",
QUnit.test( "Options 'reload' works",
function( assert ) {
var pagecontainer = $( ":mobile-pagecontainer" );

pagecontainer.pagecontainer( "load", "stuff.html", {
reload: true,
reloadPage: false
reload: true
} );

assert.strictEqual( triggerData.options.reload, true,
"The value of option 'reload' is not affected by the value of option 'reloadPage'" );

pagecontainer.pagecontainer( "load", "stuff.html", {
reloadPage: true
} );

assert.strictEqual( triggerData.options.reload, true,
"The value of option 'reloadPage' is copied to the value of option 'reload' if the " +
"latter is absent from the options hash" );
} );

QUnit.module( "_handleDialog()" );
Expand Down

0 comments on commit a9a7089

Please sign in to comment.