mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 15:06:17 +08:00
FIX: Topic map should be expanded by default when > 50 posts
This commit is contained in:
parent
25dc5043e3
commit
1009dc9be1
|
@ -185,8 +185,8 @@ export default createWidget('topic-map', {
|
|||
tagName: 'div.topic-map',
|
||||
buildKey: attrs => `topic-map-${attrs.id}`,
|
||||
|
||||
defaultState() {
|
||||
return { collapsed: true };
|
||||
defaultState(attrs) {
|
||||
return { collapsed: attrs.topicPostsCount < 50 };
|
||||
},
|
||||
|
||||
html(attrs, state) {
|
||||
|
|
|
@ -140,7 +140,7 @@ export default class Widget {
|
|||
if (prev && prev.state) {
|
||||
this.state = prev.state;
|
||||
} else {
|
||||
this.state = this.defaultState();
|
||||
this.state = this.defaultState(this.attrs, this.state);
|
||||
}
|
||||
|
||||
// Sometimes we pass state down from the parent
|
||||
|
|
Loading…
Reference in New Issue
Block a user