FIX: `refreshTitle` error when navigating to a 404 page
This commit is contained in:
parent
31e9cafe0e
commit
224f503e6f
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
model: function(params) {
|
model: function(params) {
|
||||||
return Discourse.SiteText.find(params.text_type);
|
return Discourse.SiteText.find(params.text_type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
model: function() {
|
model: function() {
|
||||||
return Discourse.SiteTextType.findAll();
|
return Discourse.SiteTextType.findAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import UserField from 'admin/models/user-field';
|
import UserField from 'admin/models/user-field';
|
||||||
|
|
||||||
export default Ember.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
model: function() {
|
model: function() {
|
||||||
return UserField.findAll();
|
return UserField.findAll();
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Discourse.AdminGroupRoute = Em.Route.extend({
|
Discourse.AdminGroupRoute = Discourse.Route.extend({
|
||||||
|
|
||||||
model: function(params) {
|
model: function(params) {
|
||||||
var groups = this.modelFor('adminGroups'),
|
var groups = this.modelFor('adminGroups'),
|
||||||
|
|
|
@ -21,6 +21,7 @@ export default ObjectController.extend(Discourse.SelectedPostsCount, {
|
||||||
|
|
||||||
// Note normally you don't have to trigger this, but topic titles can be updated
|
// Note normally you don't have to trigger this, but topic titles can be updated
|
||||||
// and are sometimes lazily loaded.
|
// and are sometimes lazily loaded.
|
||||||
|
console.log(title);
|
||||||
this.send('refreshTitle');
|
this.send('refreshTitle');
|
||||||
}
|
}
|
||||||
}.observes('title'),
|
}.observes('title'),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var ApplicationRoute = Em.Route.extend({
|
var ApplicationRoute = Discourse.Route.extend({
|
||||||
|
|
||||||
siteTitle: Discourse.computed.setting('title'),
|
siteTitle: Discourse.computed.setting('title'),
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
@namespace Discourse
|
@namespace Discourse
|
||||||
@module Discourse
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
Discourse.Route = Em.Route.extend({
|
Discourse.Route = Ember.Route.extend({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
NOT called every time we enter a route on Discourse.
|
NOT called every time we enter a route on Discourse.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
model: function(params) {
|
model: function(params) {
|
||||||
return Discourse.Topic.idForSlug(params.slug);
|
return Discourse.Topic.idForSlug(params.slug);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Discourse.UnknownRoute = Em.Route.extend({
|
Discourse.UnknownRoute = Discourse.Route.extend({
|
||||||
model: function() {
|
model: function() {
|
||||||
return Discourse.ajax("/404-body", {dataType: 'html'});
|
return Discourse.ajax("/404-body", {dataType: 'html'});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Em.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
|
|
||||||
beforeModel: function() {
|
beforeModel: function() {
|
||||||
return this.replaceWith('userActivity');
|
return this.replaceWith('userActivity');
|
||||||
|
|
Loading…
Reference in New Issue