This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/discovery_top_controller.js
2014-05-05 13:58:57 -04:00

29 lines
740 B
JavaScript

/**
The controller for discoverying 'Top' topics
@class DiscoveryTopController
@extends Discourse.Controller
@namespace Discourse
@module Discourse
**/
Discourse.DiscoveryTopController = Discourse.DiscoveryController.extend({
needs: ['discovery'],
actions: {
refresh: function() {
var self = this;
// Don't refresh if we're still loading
if (this.get('controllers.discovery.loading')) { return; }
this.send('loading');
Discourse.TopList.find().then(function(top_lists) {
self.set('model', top_lists);
self.send('loadingComplete');
});
}
},
hasDisplayedAllTopLists: Em.computed.and('content.yearly', 'content.monthly', 'content.weekly', 'content.daily')
});