Merge pull request #4760 from nbianca/fix_topic_title
Fixes duplicated title in header after edit
This commit is contained in:
commit
2c952e1981
|
@ -64,6 +64,24 @@ export default Ember.Component.extend(AddArchetypeClass, Scrolling, {
|
|||
this.appEvents.on('post:highlight', postNumber => {
|
||||
Ember.run.scheduleOnce('afterRender', null, highlight, postNumber);
|
||||
});
|
||||
|
||||
this.appEvents.on('header:update-topic', topic => {
|
||||
|
||||
if (topic === null) {
|
||||
this._lastShowTopic = false;
|
||||
this.appEvents.trigger('header:hide-topic');
|
||||
return;
|
||||
}
|
||||
|
||||
const offset = window.pageYOffset || $('html').scrollTop();
|
||||
this._lastShowTopic = this.showTopicInHeader(topic, offset);
|
||||
|
||||
if (this._lastShowTopic) {
|
||||
this.appEvents.trigger('header:show-topic', topic);
|
||||
} else {
|
||||
this.appEvents.trigger('header:hide-topic');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
|
|
|
@ -913,7 +913,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||
if (data.reload_topic) {
|
||||
topic.reload().then(() => {
|
||||
this.send('postChangedRoute', topic.get('post_number') || 1);
|
||||
this.appEvents.trigger('header:show-topic', topic);
|
||||
this.appEvents.trigger('header:update-topic', topic);
|
||||
});
|
||||
} else {
|
||||
if (topic.get('isPrivateMessage') &&
|
||||
|
|
Loading…
Reference in New Issue