discourse/app/assets/javascripts/admin/components/site-text-summary.js.es6

28 lines
582 B
Plaintext
Raw Normal View History

2018-06-15 11:03:24 -04:00
import { on } from "ember-addons/ember-computed-decorators";
export default Ember.Component.extend({
2018-06-15 11:03:24 -04:00
classNames: ["site-text"],
classNameBindings: ["siteText.overridden"],
2018-06-15 11:03:24 -04:00
@on("didInsertElement")
highlightTerm() {
2018-06-15 11:03:24 -04:00
const term = this.get("term");
if (term) {
2018-06-15 11:03:24 -04:00
this.$(".site-text-id, .site-text-value").highlight(term, {
className: "text-highlight"
});
}
2018-06-15 11:03:24 -04:00
this.$(".site-text-value").ellipsis();
},
click() {
2018-06-15 11:03:24 -04:00
this.send("edit");
},
actions: {
edit() {
2018-06-15 11:03:24 -04:00
this.sendAction("editAction", this.get("siteText"));
}
}
});