mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:11:56 +08:00
Avoid JSX to workaround Mithril 0.1.x weirdness. closes flarum/core#975
This commit is contained in:
parent
371e2ef759
commit
7031ef7ef7
@ -41,8 +41,11 @@ export default class CommentPost extends Post {
|
||||
}
|
||||
|
||||
content() {
|
||||
// Note: we avoid using JSX for the <ul> below because it results in some
|
||||
// weirdness in Mithril.js 0.1.x (see flarum/core#975). This workaround can
|
||||
// be reverted when we upgrade to Mithril 1.0.
|
||||
return super.content().concat([
|
||||
<header className="Post-header"><ul>{listItems(this.headerItems().toArray())}</ul></header>,
|
||||
<header className="Post-header">{m('ul', listItems(this.headerItems().toArray()))}</header>,
|
||||
<div className="Post-body">
|
||||
{this.isEditing()
|
||||
? <div className="Post-preview" config={this.configPreview.bind(this)}/>
|
||||
|
@ -39,17 +39,15 @@ export default function listItems(items) {
|
||||
item.attrs.key = item.attrs.key || item.itemName;
|
||||
}
|
||||
|
||||
return [
|
||||
isListItem
|
||||
? item
|
||||
: <li className={classList([
|
||||
(item.itemName ? 'item-' + item.itemName : ''),
|
||||
className,
|
||||
(active ? 'active' : '')
|
||||
])}
|
||||
key={item.itemName}>
|
||||
{item}
|
||||
</li>
|
||||
];
|
||||
return isListItem
|
||||
? item
|
||||
: <li className={classList([
|
||||
(item.itemName ? 'item-' + item.itemName : ''),
|
||||
className,
|
||||
(active ? 'active' : '')
|
||||
])}
|
||||
key={item.itemName}>
|
||||
{item}
|
||||
</li>;
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user