mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08:00
FEATURE: custom emojis
This commit is contained in:
20
app/assets/javascripts/admin/controllers/admin-emojis.js.es6
Normal file
20
app/assets/javascripts/admin/controllers/admin-emojis.js.es6
Normal file
@ -0,0 +1,20 @@
|
||||
export default Ember.ArrayController.extend({
|
||||
sortProperties: ["name"],
|
||||
|
||||
actions: {
|
||||
emojiUploaded: function (emoji) {
|
||||
this.pushObject(emoji);
|
||||
},
|
||||
|
||||
destroy: function(emoji) {
|
||||
var self = this;
|
||||
return bootbox.confirm(I18n.t("admin.emoji.delete_confirm", { name: emoji.name }), I18n.t("no_value"), I18n.t("yes_value"), function (destroy) {
|
||||
if (destroy) {
|
||||
return Discourse.ajax("/admin/customize/emojis/" + emoji.name, { type: "DELETE" }).then(function() {
|
||||
self.removeObject(emoji);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user