mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 01:07:29 +08:00
FIX: Don't use prototype extensions like .observes
This commit is contained in:
parent
394b5db848
commit
683a1210e3
|
@ -1,13 +1,14 @@
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import highlightSearch from "discourse/lib/highlight-search";
|
import highlightSearch from "discourse/lib/highlight-search";
|
||||||
|
import { observes, on } from "discourse-common/utils/decorators";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "span",
|
tagName: "span",
|
||||||
|
|
||||||
|
@on("didInsertElement")
|
||||||
|
@observes("highlight")
|
||||||
_highlightOnInsert: function() {
|
_highlightOnInsert: function() {
|
||||||
const term = this.highlight;
|
const term = this.highlight;
|
||||||
highlightSearch(this.element, term);
|
highlightSearch(this.element, term);
|
||||||
}
|
}
|
||||||
.observes("highlight")
|
|
||||||
.on("didInsertElement")
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user