Ember wants a ListTopController, not a TopController
This commit is contained in:
parent
af3d262bf3
commit
53006d7778
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
Controller of the top page
|
||||
|
||||
@class TopController
|
||||
@class ListTopController
|
||||
@extends Discourse.ObjectController
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.TopController = Discourse.ObjectController.extend({
|
||||
Discourse.ListTopController = Discourse.ObjectController.extend({
|
||||
|
||||
redirectedToTopPageReason: function() {
|
||||
// no need for a reason if the default homepage is "top"
|
|
@ -1,5 +1,9 @@
|
|||
Discourse.ListTopRoute = Discourse.Route.extend({
|
||||
|
||||
model: function() {
|
||||
return Discourse.TopList.find();
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
this._super();
|
||||
// will mark the "top" navigation item as selected
|
||||
|
@ -9,13 +13,6 @@ Discourse.ListTopRoute = Discourse.Route.extend({
|
|||
});
|
||||
},
|
||||
|
||||
setupController: function() {
|
||||
var topController = this.controllerFor("top");
|
||||
Discourse.TopList.find().then(function (result) {
|
||||
topController.set("model", result);
|
||||
});
|
||||
},
|
||||
|
||||
renderTemplate: function() {
|
||||
this.render('top', { into: 'list', outlet: 'listView' });
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue