mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
Ember wants a ListTopController, not a TopController
This commit is contained in:
parent
af3d262bf3
commit
53006d7778
2 changed files with 6 additions and 9 deletions
|
@ -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 a new issue