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

defaultHandler is not invoked when customer handlers are not specified #90

Open
AlexBulankou opened this issue Mar 21, 2016 · 0 comments

Comments

@AlexBulankou
Copy link

If I configure my router like this (no specific handlers, but I would like defaultHandler to fire)

var router=new $.mobile.Router({            
        },{ 
        },{ 
          defaultHandler: function(type, ui, page) {
            console.log("Default handler called due to unknown route (" 
              + type + ", " + ui + ", " + page + ")"
            );
          },
          defaultHandlerEvents: "bc,c,i,bs,s,bh,h",
      defaultArgsRe: true
        });

defaultHandler is not invoked.
But it is invoked when I specify at least one route:

var router=new $.mobile.Router({   
              "#index": { handler: function(type){
            console.log("Index has been "+(type=="pagehide"?"hidden":"shown"));
          }, events: "h,s" }    
        },{
        },{ 
          defaultHandler: function(type, ui, page) {
            console.log("Default handler called due to unknown route (" 
              + type + ", " + ui + ", " + page + ")"
            );
          },
          defaultHandlerEvents: "bc,c,i,bs,s,bh,h",
      defaultArgsRe: true
        });

Expected: defaultHandler to be invoked even without specific routes specified. I read through the introduction page, don't think this is intended behavior.

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

1 participant