Removed many unnecessary paths that included content.x when just x would do.

This commit is contained in:
Robin Ward
2013-05-20 15:27:58 -04:00
parent 9544cfd7dc
commit 42248a7164
24 changed files with 167 additions and 173 deletions

View File

@ -6,7 +6,7 @@
@namespace Discourse
@module Discourse
**/
Discourse.AdminCustomizeController = Ember.Controller.extend({
Discourse.AdminCustomizeController = Ember.ArrayController.extend({
/**
Create a new customization style
@ -15,8 +15,8 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
**/
newCustomization: function() {
var item = Discourse.SiteCustomization.create({name: Em.String.i18n("admin.customize.new_style")});
this.get('content').pushObject(item);
this.set('content.selectedItem', item);
this.pushObject(item);
this.set('selectedItem', item);
},
/**
@ -26,7 +26,7 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
@param {Discourse.SiteCustomization} style The style we are selecting
**/
selectStyle: function(style) {
this.set('content.selectedItem', style);
this.set('selectedItem', style);
},
/**
@ -35,7 +35,7 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
@method save
**/
save: function() {
this.get('content.selectedItem').save();
this.get('selectedItem').save();
},
/**
@ -48,10 +48,10 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
return bootbox.confirm(Em.String.i18n("admin.customize.delete_confirm"), Em.String.i18n("no_value"), Em.String.i18n("yes_value"), function(result) {
var selected;
if (result) {
selected = _this.get('content.selectedItem');
selected = _this.get('selectedItem');
selected.destroy();
_this.set('content.selectedItem', null);
return _this.get('content').removeObject(selected);
_this.set('selectedItem', null);
return _this.removeObject(selected);
}
});
}