Cleaned up JS, added basic documentation support for Admin Controllers

This commit is contained in:
Robin Ward
2013-02-21 12:58:21 -05:00
parent 6096a447b7
commit 13f8f3c45e
9 changed files with 101 additions and 72 deletions

View File

@ -1,25 +1,30 @@
(function() {
/**
This controller supports interface for creating custom CSS skins in Discourse.
@class AdminCustomizeController
@extends Ember.Controller
@namespace Discourse
@module Discourse
**/
window.Discourse.AdminCustomizeController = Ember.Controller.extend({
newCustomization: function() {
var item;
item = Discourse.SiteCustomization.create({
name: 'New Style'
});
var item = Discourse.SiteCustomization.create({name: 'New Style'});
this.get('content').pushObject(item);
return this.set('content.selectedItem', item);
this.set('content.selectedItem', item);
},
selectStyle: function(style) {
return this.set('content.selectedItem', style);
this.set('content.selectedItem', style);
},
save: function() {
return this.get('content.selectedItem').save();
this.get('content.selectedItem').save();
},
"delete": function() {
destroy: function() {
var _this = this;
return bootbox.confirm(Em.String.i18n("admin.customize.delete_confirm"), Em.String.i18n("no_value"), Em.String.i18n("yes_value"), function(result) {
var selected;
@ -31,7 +36,7 @@
}
});
}
});
}).call(this);