mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
6c5548c2e4
* Fix: Replacing custom gif image results in old gif appearing in admin page * refactor as per the review comment
26 lines
705 B
JavaScript
26 lines
705 B
JavaScript
export default Ember.ArrayController.extend({
|
|
sortProperties: ["name"],
|
|
|
|
actions: {
|
|
emojiUploaded(emoji) {
|
|
emoji.url += "?t=" + new Date().getTime();
|
|
this.pushObject(Ember.Object.create(emoji));
|
|
},
|
|
|
|
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);
|
|
});
|
|
}
|
|
}
|
|
);
|
|
}
|
|
}
|
|
});
|