mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 05:20:23 +08:00
Removed many unnecessary paths that included content.x
when just x
would do.
This commit is contained in:
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user