A mucher saner API for updating the title of routes, even when nested.

Properly sends the title of the page to google analytics
This commit is contained in:
Robin Ward
2014-10-09 14:37:23 -04:00
parent e8637344c3
commit 5fc150e057
17 changed files with 106 additions and 72 deletions

View File

@ -1,6 +1,13 @@
var ApplicationRoute = Em.Route.extend({
siteTitle: Discourse.computed.setting('title'),
actions: {
_collectTitleTokens: function(tokens) {
tokens.push(this.get('siteTitle'));
Discourse.set('_docTitle', tokens.join(' - '));
},
showTopicEntrance: function(data) {
this.controllerFor('topic-entrance').send('show', data);
},