mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 08:00:24 +08:00
Clean up application controller
This commit is contained in:
parent
bb5ec3929b
commit
b6efee1f1e
|
@ -10,19 +10,7 @@ export default Ember.Controller.extend({
|
|||
// controllers/views.
|
||||
pageTitle: '',
|
||||
|
||||
// When either the forum title or the page title changes, we want to
|
||||
// refresh the document's title.
|
||||
updateTitle: function() {
|
||||
var parts = [this.get('forumTitle')];
|
||||
var pageTitle = this.get('pageTitle');
|
||||
if (pageTitle) {
|
||||
parts.unshift(pageTitle);
|
||||
}
|
||||
document.title = parts.join(' - ');
|
||||
}.observes('pageTitle', 'forumTitle'),
|
||||
|
||||
// Whether or not a pane is currently pinned to the side of the interface.
|
||||
panePinned: false,
|
||||
backButtonTarget: null,
|
||||
|
||||
searchQuery: '',
|
||||
searchActive: false,
|
||||
|
|
|
@ -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'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user