mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 01:26:29 +08:00
28 lines
582 B
JavaScript
28 lines
582 B
JavaScript
import { on } from "ember-addons/ember-computed-decorators";
|
|
|
|
export default Ember.Component.extend({
|
|
classNames: ["site-text"],
|
|
classNameBindings: ["siteText.overridden"],
|
|
|
|
@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"));
|
|
}
|
|
}
|
|
});
|