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,22 +1,30 @@
(function() {
/**
This controller supports the interface for dealing with flags in the admin section.
@class AdminFlagsController
@extends Ember.Controller
@namespace Discourse
@module Discourse
**/
window.Discourse.AdminFlagsController = Ember.Controller.extend({
clearFlags: function(item) {
var _this = this;
return item.clearFlags().then((function() {
return _this.content.removeObject(item);
item.clearFlags().then((function() {
_this.content.removeObject(item);
}), (function() {
return bootbox.alert("something went wrong");
bootbox.alert("something went wrong");
}));
},
deletePost: function(item) {
var _this = this;
return item.deletePost().then((function() {
return _this.content.removeObject(item);
item.deletePost().then((function() {
_this.content.removeObject(item);
}), (function() {
return bootbox.alert("something went wrong");
bootbox.alert("something went wrong");
}));
},