Skip to content
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

handler getting called twice even when step "url" selected #79

Open
chapak0 opened this issue Aug 1, 2013 · 1 comment
Open

handler getting called twice even when step "url" selected #79

chapak0 opened this issue Aug 1, 2013 · 1 comment

Comments

@chapak0
Copy link

chapak0 commented Aug 1, 2013

This is what my router looks like:

var katanarouter = new $.mobile.Router([
{"#home" : {handler: "findstorestart", events: "bs", argsre: true}},
{"#carmake" : {handler: "carmake", events: "bC", argsre: true, step: "url"}}
],

    {
        home : function(eventType, matchObj, ui, page, event) {
            // code here
            console.log("findstorestart handler");
        },  
        carmake : function(eventType, matchObj, ui, page, event) {
            // code here
            event.preventDefault();
            console.log("carmake handler");
            setTimeout(function(){
                getMakes(ui);   
            },600);

        }
    });

getmakes calls a webservice and returns data but the service gets called twice. Is there a known bug, or it's meant to work like this?

@azicchetti
Copy link
Owner

Uhm, with step=url the handler should be called just once.

Your code is very similar to the test-bC.html example, which seems to work well with jQM 1.3.x and with the new 1.4 alpha.

Can you please check whether getMakes() invokes ui.bCDeferred.resolve() to perform the page transition instead of calling $.mobile.changePage ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants