discourse/app/assets/javascripts/admin/components/admin-watched-word.js.es6
2018-06-15 17:03:24 +02:00

29 lines
695 B
JavaScript

import { iconHTML } from "discourse-common/lib/icon-library";
import { bufferedRender } from "discourse-common/lib/buffered-render";
export default Ember.Component.extend(
bufferedRender({
classNames: ["watched-word"],
buildBuffer(buffer) {
buffer.push(iconHTML("times"));
buffer.push(" " + this.get("word.word"));
},
click() {
this.get("word")
.destroy()
.then(() => {
this.sendAction("action", this.get("word"));
})
.catch(e => {
bootbox.alert(
I18n.t("generic_error_with_reason", {
error: `http: ${e.status} - ${e.body}`
})
);
});
}
})
);