mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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',
|
tagName: 'div.topic-map',
|
||||||
buildKey: attrs => `topic-map-${attrs.id}`,
|
buildKey: attrs => `topic-map-${attrs.id}`,
|
||||||
|
|
||||||
defaultState() {
|
defaultState(attrs) {
|
||||||
return { collapsed: true };
|
return { collapsed: attrs.topicPostsCount < 50 };
|
||||||
},
|
},
|
||||||
|
|
||||||
html(attrs, state) {
|
html(attrs, state) {
|
||||||
|
@ -140,7 +140,7 @@ export default class Widget {
|
|||||||
if (prev && prev.state) {
|
if (prev && prev.state) {
|
||||||
this.state = prev.state;
|
this.state = prev.state;
|
||||||
} else {
|
} else {
|
||||||
this.state = this.defaultState();
|
this.state = this.defaultState(this.attrs, this.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sometimes we pass state down from the parent
|
// Sometimes we pass state down from the parent
|
||||||
|
Loading…
Reference in New Issue
Block a user