Ember wants a ListTopController, not a TopController

This commit is contained in:
Régis Hanol 2014-01-07 01:36:30 +01:00
parent af3d262bf3
commit 53006d7778
2 changed files with 6 additions and 9 deletions

View file

@ -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"

View file

@ -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' });
},