mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +08:00
Fix existing Post component classes being dropped
This commit is contained in:
parent
607eeb530d
commit
0b3ce2e7d0
|
@ -39,7 +39,7 @@ export default class Post extends Component {
|
||||||
view() {
|
view() {
|
||||||
const attrs = this.attrs();
|
const attrs = this.attrs();
|
||||||
|
|
||||||
attrs.className = this.classes().join(' ');
|
attrs.className = this.classes(attrs.className).join(' ');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article {...attrs}>
|
<article {...attrs}>
|
||||||
|
@ -98,8 +98,14 @@ export default class Post extends Component {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
classes() {
|
/**
|
||||||
let classes = ['Post'];
|
* Get the post's classes.
|
||||||
|
*
|
||||||
|
* @param string classes
|
||||||
|
* @returns {string[]}
|
||||||
|
*/
|
||||||
|
classes(existing) {
|
||||||
|
let classes = (existing || '').split(' ').concat(['Post']);
|
||||||
|
|
||||||
if (this.loading) {
|
if (this.loading) {
|
||||||
classes.push('Post--loading');
|
classes.push('Post--loading');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user