diff --git a/app/assets/javascripts/discourse/controllers/top_controller.js b/app/assets/javascripts/discourse/controllers/list_top_controller.js similarity index 90% rename from app/assets/javascripts/discourse/controllers/top_controller.js rename to app/assets/javascripts/discourse/controllers/list_top_controller.js index cf5240552..cc0b6d0a7 100644 --- a/app/assets/javascripts/discourse/controllers/top_controller.js +++ b/app/assets/javascripts/discourse/controllers/list_top_controller.js @@ -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" diff --git a/app/assets/javascripts/discourse/routes/list_top_route.js b/app/assets/javascripts/discourse/routes/list_top_route.js index ca11d830d..d6a3fb213 100644 --- a/app/assets/javascripts/discourse/routes/list_top_route.js +++ b/app/assets/javascripts/discourse/routes/list_top_route.js @@ -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' }); },