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/discourse-linked-text.js
2020-12-01 15:31:26 -03:00

23 lines
462 B
JavaScript

import Component from "@ember/component";
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
tagName: "span",
@discourseComputed("text", "textParams")
translatedText(text) {
if (text) {
return I18n.t(...arguments);
}
},
click(event) {
if (event.target.tagName.toUpperCase() === "A") {
this.action(this.actionParam);
}
return false;
},
});