Allow route maps to access `site` easily

This commit is contained in:
Robin Ward 2017-08-09 11:49:04 -04:00
parent a1f60cfcb8
commit 5ba3a2bd9d
1 changed files with 2 additions and 1 deletions

View File

@ -32,6 +32,7 @@ class RouteNode {
this.children = [];
this.childrenByName = {};
this.paths = {};
this.site = Discourse.Site.current();
if (!opts.path) {
opts.path = name;
@ -119,7 +120,7 @@ export function mapRoutes() {
});
extras.forEach(extra => {
const node = tree.findPath(extra.resource);
let node = tree.findPath(extra.resource);
if (node) {
node.extract(extra.map);
}