always select exact route if it exists
This commit is contained in:
parent
57021b6b5e
commit
fa824ca080
1 changed files with 14 additions and 5 deletions
|
|
@ -653,6 +653,15 @@ var m = (function app(window, undefined) {
|
|||
path = path.substr(0, queryStart)
|
||||
}
|
||||
|
||||
// Get all routes and check if there's
|
||||
// an exact match for the current path
|
||||
var keys = Object.keys(router);
|
||||
var index = keys.indexOf(path);
|
||||
if(index !== -1){
|
||||
m.module(root, router[keys [index]]);
|
||||
return true;
|
||||
}
|
||||
|
||||
for (var route in router) {
|
||||
if (route === path) {
|
||||
m.module(root, router[route]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue