Merge branch 'next' into components
This commit is contained in:
commit
1ed2ffe118
1 changed files with 10 additions and 1 deletions
11
mithril.js
11
mithril.js
|
|
@ -120,7 +120,7 @@ var m = (function app(window, undefined) {
|
||||||
len = data.length
|
len = data.length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var nodes = [], intact = cached.length === data.length, subArrayCount = 0;
|
var nodes = [], intact = cached.length === data.length, subArrayCount = 0;
|
||||||
|
|
||||||
//keys algorithm: sort elements without recreating them if keys are present
|
//keys algorithm: sort elements without recreating them if keys are present
|
||||||
|
|
@ -697,6 +697,15 @@ var m = (function app(window, undefined) {
|
||||||
path = path.substr(0, queryStart)
|
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) {
|
for (var route in router) {
|
||||||
if (route === path) {
|
if (route === path) {
|
||||||
m.module(root, router[route]);
|
m.module(root, router[route]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue