mirror of
https://github.com/flarum/framework.git
synced 2025-02-23 02:03:09 +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() {
|
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([
|
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">
|
<div className="Post-body">
|
||||||
{this.isEditing()
|
{this.isEditing()
|
||||||
? <div className="Post-preview" config={this.configPreview.bind(this)}/>
|
? <div className="Post-preview" config={this.configPreview.bind(this)}/>
|
||||||
|
@ -39,8 +39,7 @@ export default function listItems(items) {
|
|||||||
item.attrs.key = item.attrs.key || item.itemName;
|
item.attrs.key = item.attrs.key || item.itemName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return isListItem
|
||||||
isListItem
|
|
||||||
? item
|
? item
|
||||||
: <li className={classList([
|
: <li className={classList([
|
||||||
(item.itemName ? 'item-' + item.itemName : ''),
|
(item.itemName ? 'item-' + item.itemName : ''),
|
||||||
@ -49,7 +48,6 @@ export default function listItems(items) {
|
|||||||
])}
|
])}
|
||||||
key={item.itemName}>
|
key={item.itemName}>
|
||||||
{item}
|
{item}
|
||||||
</li>
|
</li>;
|
||||||
];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user