mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
29 lines
667 B
JavaScript
29 lines
667 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.word
|
|
.destroy()
|
|
.then(() => {
|
|
this.action(this.word);
|
|
})
|
|
.catch(e => {
|
|
bootbox.alert(
|
|
I18n.t("generic_error_with_reason", {
|
|
error: `http: ${e.status} - ${e.body}`
|
|
})
|
|
);
|
|
});
|
|
}
|
|
})
|
|
);
|