1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 01:31:40 +02:00

Patch Mithril with a route shortcut attribute

Instead of:

<a href={app.route.user(user)} config={m.route}>

We can use:

<a route={app.route.user(user)}>
This commit is contained in:
Toby Zerner
2015-09-22 17:09:38 +09:30
parent 5203be4ec8
commit 0cf973ced9
2 changed files with 8 additions and 0 deletions

View File

@@ -14,6 +14,13 @@ export default function patchMithril(global) {
m.bidi(node, node.attrs.bidi);
}
if (node.attrs.route) {
node.attrs.href = node.attrs.route;
node.attrs.config = m.route;
delete node.attrs.route;
}
return node;
};