mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 14:49:57 +08:00
Patch Mithril with a bidi attribute
Enables quick bidirectional bindings. So instead of this: <input value={prop()} oninput={m.withAttr('value', prop)}/> ... we can do this: <input bidi={prop}/>
This commit is contained in:
@ -8,8 +8,14 @@ export default function patchMithril(global) {
|
||||
return comp.component(...args);
|
||||
}
|
||||
|
||||
return mo.apply(this, arguments);
|
||||
}
|
||||
const node = mo.apply(this, arguments);
|
||||
|
||||
if (node.attrs.bidi) {
|
||||
m.bidi(node, node.attrs.bidi);
|
||||
}
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
Object.keys(mo).forEach(key => m[key] = mo[key]);
|
||||
|
||||
|
Reference in New Issue
Block a user