2017-07-26 16:25:09 -04:00
|
|
|
import { iconHTML } from 'discourse-common/lib/icon-library';
|
2017-06-28 16:56:44 -04:00
|
|
|
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 => {
|
2017-07-27 12:26:55 -04:00
|
|
|
bootbox.alert(I18n.t("generic_error_with_reason", {error: `http: ${e.status} - ${e.body}`}));
|
2017-06-28 16:56:44 -04:00
|
|
|
});;
|
|
|
|
}
|
|
|
|
}));
|