mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 23:05:30 +08:00
20 lines
583 B
Plaintext
20 lines
583 B
Plaintext
|
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||
|
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}));
|
||
|
});;
|
||
|
}
|
||
|
}));
|