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/app/components/highlight-search.js

15 lines
384 B
JavaScript

import { observes, on } from "discourse-common/utils/decorators";
import Component from "@ember/component";
import highlightSearch from "discourse/lib/highlight-search";
export default Component.extend({
tagName: "span",
@on("didInsertElement")
@observes("highlight")
_highlightOnInsert() {
const term = this.highlight;
highlightSearch(this.element, term);
},
});