discourse/app/assets/javascripts/admin/components/admin-watched-word.js.es6
Joffrey JAFFEUX f9648de897
DEV: upgrades from Ember 2.13 to Ember 3.5.1 (#6808)
Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: David Taylor <david@taylorhq.com>
2019-01-10 11:06:01 +01:00

29 lines
681 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.action(this.get("word"));
})
.catch(e => {
bootbox.alert(
I18n.t("generic_error_with_reason", {
error: `http: ${e.status} - ${e.body}`
})
);
});
}
})
);