FIX: Double header rendering issues, redux
This commit is contained in:
parent
94cee37edd
commit
b22df9f166
|
@ -92,17 +92,18 @@ export default Ember.Component.extend(CleansUp, {
|
||||||
this.appEvents.off('topic-entrance:show');
|
this.appEvents.off('topic-entrance:show');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_jumpTo(destination) {
|
||||||
|
this.cleanUp();
|
||||||
|
DiscourseURL.routeTo(destination);
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
enterTop() {
|
enterTop() {
|
||||||
const topic = this.get('topic');
|
this._jumpTo(this.get('topic.url'));
|
||||||
this.appEvents.trigger('header:update-topic', topic);
|
|
||||||
DiscourseURL.routeTo(topic.get('url'));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
enterBottom() {
|
enterBottom() {
|
||||||
const topic = this.get('topic');
|
this._jumpTo(this.get('topic.lastPostUrl'));
|
||||||
this.appEvents.trigger('header:update-topic', topic);
|
|
||||||
DiscourseURL.routeTo(topic.get('lastPostUrl'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -218,6 +218,10 @@ const TopicRoute = Discourse.Route.extend({
|
||||||
|
|
||||||
// We reset screen tracking every time a topic is entered
|
// We reset screen tracking every time a topic is entered
|
||||||
this.screenTrack.start(model.get('id'), controller);
|
this.screenTrack.start(model.get('id'), controller);
|
||||||
|
|
||||||
|
Ember.run.scheduleOnce('afterRender', () => {
|
||||||
|
this.appEvents.trigger('header:update-topic', model);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue