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
Sam 0791d740a6 FIX: only highlight exact word matches in results
- also fixes phrase highlighting
2017-07-20 12:26:46 -04:00

12 lines
283 B
JavaScript

import highlightText from 'discourse/lib/highlight-text';
export default Ember.Component.extend({
tagName: 'span',
_highlightOnInsert: function() {
const term = this.get('highlight');
highlightText(this.$(), term);
}.observes('highlight').on('didInsertElement')
});