2014-12-22 19:12:26 -05:00
|
|
|
export default Ember.ArrayController.extend({
|
|
|
|
sortProperties: ["name"],
|
|
|
|
|
|
|
|
actions: {
|
2015-05-20 10:45:31 -04:00
|
|
|
emojiUploaded(emoji) {
|
2016-04-26 11:23:21 -04:00
|
|
|
emoji.url += "?t=" + new Date().getTime();
|
|
|
|
this.pushObject(Ember.Object.create(emoji));
|
2014-12-22 19:12:26 -05:00
|
|
|
},
|
|
|
|
|
2015-05-20 10:45:31 -04:00
|
|
|
destroy(emoji) {
|
|
|
|
const self = this;
|
|
|
|
return bootbox.confirm(
|
|
|
|
I18n.t("admin.emoji.delete_confirm", { name: emoji.get("name") }),
|
|
|
|
I18n.t("no_value"),
|
|
|
|
I18n.t("yes_value"),
|
|
|
|
function(destroy) {
|
|
|
|
if (destroy) {
|
|
|
|
return Discourse.ajax("/admin/customize/emojis/" + emoji.get("name"), { type: "DELETE" }).then(function() {
|
|
|
|
self.removeObject(emoji);
|
|
|
|
});
|
|
|
|
}
|
2014-12-22 19:12:26 -05:00
|
|
|
}
|
2015-05-20 10:45:31 -04:00
|
|
|
);
|
2014-12-22 19:12:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|