Merge pull request #4760 from nbianca/fix_topic_title

Fixes duplicated title in header after edit
This commit is contained in:
Sam 2017-03-16 11:49:45 -04:00 committed by GitHub
commit 2c952e1981
2 changed files with 19 additions and 1 deletions

View File

@ -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() {

View File

@ -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') &&