mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-29 18:46:23 -05:00
25 lines
520 B
Text
25 lines
520 B
Text
|
import { on } from 'ember-addons/ember-computed-decorators';
|
||
|
|
||
|
export default Ember.Component.extend({
|
||
|
classNames: ['site-text'],
|
||
|
|
||
|
@on('didInsertElement')
|
||
|
highlightTerm() {
|
||
|
const term = this.get('term');
|
||
|
if (term) {
|
||
|
this.$('.site-text-id, .site-text-value').highlight(term, {className: 'text-highlight'});
|
||
|
}
|
||
|
this.$('.site-text-value').ellipsis();
|
||
|
},
|
||
|
|
||
|
click() {
|
||
|
this.send('edit');
|
||
|
},
|
||
|
|
||
|
actions: {
|
||
|
edit() {
|
||
|
this.sendAction('editAction', this.get('siteText'));
|
||
|
}
|
||
|
}
|
||
|
});
|