mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +02:00
ComposerPostPreview: Allow injecting CSS class
This commit is contained in:
@@ -51,7 +51,7 @@ export default class CommentPost extends Post {
|
|||||||
<ul>{listItems(this.headerItems().toArray())}</ul>
|
<ul>{listItems(this.headerItems().toArray())}</ul>
|
||||||
</header>,
|
</header>,
|
||||||
<div className="Post-body">
|
<div className="Post-body">
|
||||||
{this.isEditing() ? <ComposerPostPreview composer={app.composer} /> : m.trust(this.attrs.post.contentHtml())}
|
{this.isEditing() ? <ComposerPostPreview className="Post-preview" composer={app.composer} /> : m.trust(this.attrs.post.contentHtml())}
|
||||||
</div>,
|
</div>,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -11,10 +11,15 @@ import Component from '../../common/Component';
|
|||||||
* ### Attrs
|
* ### Attrs
|
||||||
*
|
*
|
||||||
* - `composer` The state of the composer controlling this preview.
|
* - `composer` The state of the composer controlling this preview.
|
||||||
|
* - `className` A CSS class for the element surrounding the preview.
|
||||||
*/
|
*/
|
||||||
export default class ComposerPostPreview extends Component {
|
export default class ComposerPostPreview extends Component {
|
||||||
|
static initAttrs(attrs) {
|
||||||
|
attrs.className = attrs.className || '';
|
||||||
|
}
|
||||||
|
|
||||||
view() {
|
view() {
|
||||||
return <div className="Post-preview" />;
|
return <div className={this.attrs.className} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
oncreate(vnode) {
|
oncreate(vnode) {
|
||||||
|
Reference in New Issue
Block a user