mirror of
https://github.com/discourse/discourse.git
synced 2025-02-27 03:24:09 +08:00
20 lines
456 B
JavaScript
20 lines
456 B
JavaScript
import { ajax } from 'discourse/lib/ajax';
|
|
|
|
export default Ember.Component.extend({
|
|
tagName: '',
|
|
|
|
actions: {
|
|
expandItem() {
|
|
const item = this.get('item');
|
|
const topicId = item.get('topic_id');
|
|
const postNumber = item.get('post_number');
|
|
|
|
return ajax(`/posts/by_number/${topicId}/${postNumber}.json`).then(result => {
|
|
item.set('truncated', false);
|
|
item.set('excerpt', result.cooked);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|