Browse Source

Pull request #1460: 无JIRA任务 整理一下

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '69769a40034160a143576fc80b0a76bf79e82ff9':
  bugfix
es6
guy 4 years ago
parent
commit
2f74a86220
  1. 20
      src/base/single/text.js

20
src/base/single/text.js

@ -3,7 +3,8 @@
* @class BI.Text
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
!(function () {
BI.Text = BI.inherit(BI.Single, {
props: {
baseCls: "bi-text",
@ -151,8 +152,17 @@ BI.Text = BI.inherit(BI.Single, {
this.text.element[0].textContent = BI.Text.formatText(this._getShowText());
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;
};
BI.shortcut("bi.text", BI.Text);
};
BI.shortcut("bi.text", BI.Text);
}());

Loading…
Cancel
Save