mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminFlagsController = Ember.Controller.extend({
|
||||
Discourse.AdminFlagsController = Ember.ArrayController.extend({
|
||||
|
||||
/**
|
||||
Clear all flags on a post
|
||||
@@ -17,10 +17,10 @@ Discourse.AdminFlagsController = Ember.Controller.extend({
|
||||
clearFlags: function(item) {
|
||||
var _this = this;
|
||||
item.clearFlags().then((function() {
|
||||
_this.content.removeObject(item);
|
||||
}), (function() {
|
||||
_this.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(Em.String.i18n("admin.flags.error"));
|
||||
}));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -32,10 +32,10 @@ Discourse.AdminFlagsController = Ember.Controller.extend({
|
||||
deletePost: function(item) {
|
||||
var _this = this;
|
||||
item.deletePost().then((function() {
|
||||
_this.content.removeObject(item);
|
||||
}), (function() {
|
||||
_this.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(Em.String.i18n("admin.flags.error"));
|
||||
}));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user