$.mobile.changePage ignores pageContainer option in JQM 1.4.0RC1 #6691

Closed
nonplus opened this Issue Nov 1, 2013 · 3 comments

Comments

Projects
None yet
5 participants

nonplus commented Nov 1, 2013

The refactored (deprecated) $.mobile.changePage method in JQM 1.4, no longer pays attention to the pageContainer specified via options. Thus, the following call will ignore the specified pageContainer:

$.mobile.changePage(to, { pageContainer: $myContainer });

The bug is in jquery.mobile.navigation.js:

Current (wrong) implementation:

    $.mobile.changePage = function( to, options ) {
        $.mobile.pageContainer.pagecontainer( "change", to, options );
    };

This could be fixed like so:

    $.mobile.changePage = function( to, options ) {
        var settings = options || {};
        (settings.pageContainer || $.mobile.pageContainer).pagecontainer( "change", to, options );
    };

Sorry, I don't have a test page for this (not easy to simplify our code...)

jonas-db commented Nov 2, 2013

As this method is deprecated i don't think you should use it anymore.. but i'm also still using it as i don't know the alternative. Can somebody elaborate this?

nonplus commented Nov 2, 2013

Deprecation simply means that the feature will likely be removed in the future - you should be able to expect for it to still work correctly in the current version.

It's unfortunately that API documentation has not been updated for 1.4 - makes it kind of hard to decide what's a bug v.s. unsupported feature that has not been removed yet.

BTW, the workaround for $.mobile.changePage() is to call pagecontainer( "change", to, options ) on the PageContainer widget. If you use the default container, you would call $.mobile.pageContainer.pagecontainer( "change", to, options ).

Contributor

gabrielschulhof commented Nov 2, 2013

@nonplus is correct - the pageContainer option of the $.mobile.changePage function's options hash should be honoured during the deprecation period. Nevertheless, you can, of course, use the non-deprecated code, wherein you would call .pagecontainer( "change", ... ) on your pagecontainer widget of choice.

@gabrielschulhof gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jan 28, 2015

@gabrielschulhof gabrielschulhof Navigation: Remove $.mobile.changePage
Fixes gh-6691
Fixes gh-7946
4ce8d95

@gabrielschulhof gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jan 28, 2015

@gabrielschulhof gabrielschulhof Navigation: Remove $.mobile.changePage
Fixes gh-6691
Fixes gh-7946
e07c2a9

@gabrielschulhof gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Apr 7, 2015

@gabrielschulhof gabrielschulhof Navigation: Remove $.mobile.changePage
Fixes gh-6691
Fixes gh-7946
20f7bfc

arschmitz added this to the 1.5.0 milestone Jun 29, 2015

@arschmitz arschmitz added a commit to arschmitz/jquery-mobile that referenced this issue Aug 7, 2015

@gabrielschulhof @arschmitz gabrielschulhof + arschmitz Navigation: Remove $.mobile.changePage
Fixes gh-6691
Fixes gh-7946
82b6009

@arschmitz arschmitz added a commit to arschmitz/jquery-mobile that referenced this issue Dec 10, 2015

@gabrielschulhof @arschmitz gabrielschulhof + arschmitz Navigation: Remove $.mobile.changePage
Fixes gh-6691
Fixes gh-7946
202d85d

apsdehal closed this May 8, 2016

@arschmitz arschmitz added a commit to arschmitz/jquery-mobile that referenced this issue Jul 4, 2016

@gabrielschulhof @arschmitz gabrielschulhof + arschmitz Navigation: Remove $.mobile.changePage
Fixes gh-6691
Fixes gh-7946
6ca700e

apsdehal self-assigned this Aug 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment