FIX: PageTracker was not sending the proper page title through at all

times.
This commit is contained in:
Robin Ward 2014-11-05 15:15:58 -05:00
parent 2d9187cd9d
commit a0e92ef57a

View File

@ -19,7 +19,13 @@ Discourse.PageTracker = Ember.Object.extend(Ember.Evented, {
router.on('didTransition', function() {
this.send('refreshTitle');
self.trigger('change', this.get('url'), Discourse.get('_docTitle'));
var url = this.get('url');
// Refreshing the title is debounced, so we need to trigger this in the
// next runloop to have the correct title.
Em.run.next(function() {
self.trigger('change', url, Discourse.get('_docTitle'));
});
});
this.set('started', true);
}