mirror of
https://github.com/discourse/discourse.git
synced 2025-06-23 22:01:33 +08:00
Fixes duplicated topic title in header after edit.
This commit is contained in:
@ -64,6 +64,24 @@ export default Ember.Component.extend(AddArchetypeClass, Scrolling, {
|
|||||||
this.appEvents.on('post:highlight', postNumber => {
|
this.appEvents.on('post:highlight', postNumber => {
|
||||||
Ember.run.scheduleOnce('afterRender', null, 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() {
|
willDestroyElement() {
|
||||||
|
@ -913,7 +913,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||||||
if (data.reload_topic) {
|
if (data.reload_topic) {
|
||||||
topic.reload().then(() => {
|
topic.reload().then(() => {
|
||||||
this.send('postChangedRoute', topic.get('post_number') || 1);
|
this.send('postChangedRoute', topic.get('post_number') || 1);
|
||||||
this.appEvents.trigger('header:show-topic', topic);
|
this.appEvents.trigger('header:update-topic', topic);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (topic.get('isPrivateMessage') &&
|
if (topic.get('isPrivateMessage') &&
|
||||||
|
Reference in New Issue
Block a user