mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 10:08:20 -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
|
Controller of the top page
|
||||||
|
|
||||||
@class TopController
|
@class ListTopController
|
||||||
@extends Discourse.ObjectController
|
@extends Discourse.ObjectController
|
||||||
@namespace Discourse
|
@namespace Discourse
|
||||||
@module Discourse
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
Discourse.TopController = Discourse.ObjectController.extend({
|
Discourse.ListTopController = Discourse.ObjectController.extend({
|
||||||
|
|
||||||
redirectedToTopPageReason: function() {
|
redirectedToTopPageReason: function() {
|
||||||
// no need for a reason if the default homepage is "top"
|
// no need for a reason if the default homepage is "top"
|
|
@ -1,5 +1,9 @@
|
||||||
Discourse.ListTopRoute = Discourse.Route.extend({
|
Discourse.ListTopRoute = Discourse.Route.extend({
|
||||||
|
|
||||||
|
model: function() {
|
||||||
|
return Discourse.TopList.find();
|
||||||
|
},
|
||||||
|
|
||||||
activate: function() {
|
activate: function() {
|
||||||
this._super();
|
this._super();
|
||||||
// will mark the "top" navigation item as selected
|
// 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() {
|
renderTemplate: function() {
|
||||||
this.render('top', { into: 'list', outlet: 'listView' });
|
this.render('top', { into: 'list', outlet: 'listView' });
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue