For Evil Trout blog part 2: switch between bar chart and table

This commit is contained in:
Robin Ward
2013-03-17 15:02:36 -04:00
parent 9511beec11
commit 0b4339c103
4 changed files with 80 additions and 2 deletions
@@ -0,0 +1,24 @@
Discourse.AdminReportsController = Ember.ObjectController.extend({
viewMode: 'table',
// true if we're viewing the table mode
viewingTable: function() {
return this.get('viewMode') === 'table';
}.property('viewMode'),
// true if we're viewing the bar chart mode
viewingBarChart: function() {
return this.get('viewMode') === 'barChart';
}.property('viewMode'),
// Changes the current view mode to 'table'
viewAsTable: function() {
this.set('viewMode', 'table');
},
// Changes the current view mode to 'barChart'
viewAsBarChart: function() {
this.set('viewMode', 'barChart');
}
});