mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Clean up application controller
This commit is contained in:
@@ -11,6 +11,17 @@ var $ = Ember.$;
|
||||
|
||||
export default Ember.View.extend({
|
||||
|
||||
// When either the forum title or the page title changes, we want to
|
||||
// refresh the document's title.
|
||||
updateTitle: function() {
|
||||
var parts = [this.get('controller.forumTitle')];
|
||||
var pageTitle = this.get('controller.pageTitle');
|
||||
if (pageTitle) {
|
||||
parts.unshift(pageTitle);
|
||||
}
|
||||
document.title = parts.join(' - ');
|
||||
}.observes('controller.pageTitle', 'controller.forumTitle'),
|
||||
|
||||
title: function() {
|
||||
return this.get('controller.forumTitle');
|
||||
}.property('controller.forumTitle'),
|
||||
|
Reference in New Issue
Block a user