A router/controller for jquery mobile. Also adds support for client-side parameters in the hash part of the url. The routes handles regexp based routes. This plugin can be used alone or (better) with Backbone.js or Spine.js, because it's originally meant to replace their router with something integrated with jQM.
GNU General Public License v2.0
402
stars
69
forks
source link
defaultHandler is not invoked when customer handlers are not specified #90
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.
If I configure my router like this (no specific handlers, but I would like defaultHandler to fire)
defaultHandler is not invoked. But it is invoked when I specify at least one route:
Expected: defaultHandler to be invoked even without specific routes specified. I read through the introduction page, don't think this is intended behavior.