New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$.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

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

This comment has been minimized.

Show comment
Hide comment
@jonas-db

jonas-db 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?

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

This comment has been minimized.

Show comment
Hide comment
@nonplus

nonplus 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 ).

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 ).

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Nov 2, 2013

Contributor

@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.

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 added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jan 28, 2015

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

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

@arschmitz arschmitz added this to the 1.5.0 milestone Jun 29, 2015

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

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

arschmitz added a commit that referenced this issue Mar 26, 2016

@apsdehal apsdehal closed this May 8, 2016

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

@apsdehal 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