This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/highlight-text.js.es6

14 lines
324 B
JavaScript

export default Ember.Component.extend({
tagName: 'span',
_highlightOnInsert: function() {
const term = this.get('highlight');
const self = this;
if(!_.isEmpty(term)) {
self.$().highlight(term.split(/\s+/), {className: 'search-highlight'});
}
}.observes('highlight').on('didInsertElement')
});