From 174f3aba90e95e432dc0338b68423255e9466025 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 11 Sep 2020 17:13:43 +0200 Subject: [PATCH] ComposerPostPreview: Allow injecting CSS class --- js/src/forum/components/CommentPost.js | 2 +- js/src/forum/components/ComposerPostPreview.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/src/forum/components/CommentPost.js b/js/src/forum/components/CommentPost.js index be5dcda64..277fbdae4 100644 --- a/js/src/forum/components/CommentPost.js +++ b/js/src/forum/components/CommentPost.js @@ -51,7 +51,7 @@ export default class CommentPost extends Post { ,
- {this.isEditing() ? : m.trust(this.attrs.post.contentHtml())} + {this.isEditing() ? : m.trust(this.attrs.post.contentHtml())}
, ]); } diff --git a/js/src/forum/components/ComposerPostPreview.js b/js/src/forum/components/ComposerPostPreview.js index 214f4ed9f..8c7a3c5c4 100644 --- a/js/src/forum/components/ComposerPostPreview.js +++ b/js/src/forum/components/ComposerPostPreview.js @@ -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
; + return
; } oncreate(vnode) {