guy 4 years ago
parent
commit
c91931f4d7
  1. 20
      src/base/single/text.js

20
src/base/single/text.js

@ -3,7 +3,8 @@
* @class BI.Text * @class BI.Text
* @extends BI.Single * @extends BI.Single
*/ */
BI.Text = BI.inherit(BI.Single, { !(function () {
BI.Text = BI.inherit(BI.Single, {
props: { props: {
baseCls: "bi-text", baseCls: "bi-text",
@ -151,8 +152,17 @@ BI.Text = BI.inherit(BI.Single, {
this.text.element[0].textContent = BI.Text.formatText(this._getShowText()); this.text.element[0].textContent = BI.Text.formatText(this._getShowText());
BI.isKey(this.options.keyword) && this.doRedMark(this.options.keyword); BI.isKey(this.options.keyword) && this.doRedMark(this.options.keyword);
} }
}); });
BI.Text.formatText = function (text) { var formatters = [];
BI.Text.addTextFormatter = function (formatter) {
formatters.push(formatter);
};
BI.Text.formatText = function (text) {
for (var i = 0, len = formatters.length; i < len; i++) {
text = formatters[i](text);
}
return text; return text;
}; };
BI.shortcut("bi.text", BI.Text); BI.shortcut("bi.text", BI.Text);
}());

Loading…
Cancel
Save