Fix JsHint

This commit is contained in:
Robin Ward 2013-05-24 11:02:17 -04:00
parent 1dae46021e
commit 56764f817b
4 changed files with 8 additions and 7 deletions

View File

@ -62,9 +62,10 @@ Discourse.AdminUser = Discourse.User.extend({
return this.get('username').toLowerCase();
}).property('username'),
trustLevel: (function() {
return Discourse.get('site.trust_levels').findProperty('id', this.get('trust_level'));
}).property('trust_level'),
trustLevel: function() {
var site = Discourse.Site.instance();
return site.get('trust_levels').findProperty('id', this.get('trust_level'));
}.property('trust_level'),
isBanned: (function() {
return this.get('is_banned') === true;

View File

@ -38,7 +38,7 @@ Discourse.Site = Discourse.Model.extend({
Discourse.Site.reopenClass({
find: function() {
instance: function() {
return Discourse.Site.create(PreloadStore.get('site'));
},

View File

@ -8,7 +8,7 @@
**/
Discourse.ApplicationRoute = Discourse.Route.extend({
setupController: function(controller) {
Discourse.set('site', Discourse.Site.find());
Discourse.set('site', Discourse.Site.instance());
var currentUser = PreloadStore.get('currentUser');
if (currentUser) {

View File

@ -9,11 +9,11 @@
Discourse.ListCategoryRoute = Discourse.FilteredListRoute.extend({
model: function(params) {
var categories = Discourse.Site.find().get('categories');
var categories = Discourse.Site.instance().get('categories');
var slug = Em.get(params, 'slug');
category = categories.findProperty('slug', Em.get(params, 'slug'))
var category = categories.findProperty('slug', Em.get(params, 'slug'))
// In case the slug didn't work, try to find it by id instead.
if (!category) {