Trivial JS clean up
This commit is contained in:
parent
6abd9ddd2d
commit
0601bb6d74
|
@ -1,15 +1,8 @@
|
||||||
Discourse.AdminReportsController = Ember.ObjectController.extend({
|
Discourse.AdminReportsController = Ember.ObjectController.extend({
|
||||||
viewMode: 'table',
|
viewMode: 'table',
|
||||||
|
|
||||||
// true if we're viewing the table mode
|
viewingTable: Em.computed.equal('viewMode', 'table'),
|
||||||
viewingTable: function() {
|
viewingBarChart: Em.computed.equal('viewMode', 'barChart'),
|
||||||
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'
|
// Changes the current view mode to 'table'
|
||||||
viewAsTable: function() {
|
viewAsTable: function() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ Discourse.AdminSiteSettingsController = Ember.ArrayController.extend(Discourse.P
|
||||||
|
|
||||||
@property filteredContent
|
@property filteredContent
|
||||||
**/
|
**/
|
||||||
filteredContent: (function() {
|
filteredContent: function() {
|
||||||
|
|
||||||
// If we have no content, don't bother filtering anything
|
// If we have no content, don't bother filtering anything
|
||||||
if (!this.present('content')) return null;
|
if (!this.present('content')) return null;
|
||||||
|
@ -37,7 +37,7 @@ Discourse.AdminSiteSettingsController = Ember.ArrayController.extend(Discourse.P
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}).property('filter', 'content.@each', 'onlyOverridden'),
|
}.property('filter', 'content.@each', 'onlyOverridden'),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset a setting to its default value
|
Reset a setting to its default value
|
||||||
|
|
|
@ -14,7 +14,7 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({
|
||||||
// If we're changing our channel
|
// If we're changing our channel
|
||||||
previousChannel: null,
|
previousChannel: null,
|
||||||
|
|
||||||
latest: Ember.computed.equal('content.filter', 'latest'),
|
latest: Ember.computed.equal('filter', 'latest'),
|
||||||
|
|
||||||
filterModeChanged: function() {
|
filterModeChanged: function() {
|
||||||
// Unsubscribe from a previous channel if necessary
|
// Unsubscribe from a previous channel if necessary
|
||||||
|
@ -76,10 +76,10 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({
|
||||||
// Show newly inserted topics
|
// Show newly inserted topics
|
||||||
showInserted: function(e) {
|
showInserted: function(e) {
|
||||||
// Move inserted into topics
|
// Move inserted into topics
|
||||||
this.get('content.topics').unshiftObjects(this.get('content.inserted'));
|
this.get('topics').unshiftObjects(this.get('inserted'));
|
||||||
|
|
||||||
// Clear inserted
|
// Clear inserted
|
||||||
this.set('content.inserted', Em.A());
|
this.set('inserted', Em.A());
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -91,9 +91,9 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({
|
||||||
|
|
||||||
footerMessage: function() {
|
footerMessage: function() {
|
||||||
if (!this.get('allLoaded')) return;
|
if (!this.get('allLoaded')) return;
|
||||||
var content = this.get('category');
|
var category = this.get('category');
|
||||||
if( content ) {
|
if( category ) {
|
||||||
return Em.String.i18n('topics.bottom.category', {category: content.get('name')});
|
return Em.String.i18n('topics.bottom.category', {category: category.get('name')});
|
||||||
} else {
|
} else {
|
||||||
var split = this.get('filter').split('/');
|
var split = this.get('filter').split('/');
|
||||||
if (this.get('topics.length') === 0) {
|
if (this.get('topics.length') === 0) {
|
||||||
|
|
Loading…
Reference in New Issue