mirror of
https://github.com/flarum/core.git
synced 2025-08-04 23:47:32 +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>
|
||||
</header>,
|
||||
<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>,
|
||||
]);
|
||||
}
|
||||
|
@@ -11,10 +11,15 @@ import Component from '../../common/Component';
|
||||
* ### Attrs
|
||||
*
|
||||
* - `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 {
|
||||
static initAttrs(attrs) {
|
||||
attrs.className = attrs.className || '';
|
||||
}
|
||||
|
||||
view() {
|
||||
return <div className="Post-preview" />;
|
||||
return <div className={this.attrs.className} />;
|
||||
}
|
||||
|
||||
oncreate(vnode) {
|
||||
|
Reference in New Issue
Block a user