Browse Source

Pull request #1609: 无JIRA任务 revert label同步value值

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit 'e351830a0cc494bcee8d8a2d6370abf2192ee8ec':
  重新调整逻辑
  无JIRA任务 revert label同步value值
es6
windy 4 years ago
parent
commit
20057338ed
  1. 38
      src/base/single/__test__/text.test.js
  2. 1
      src/base/single/button/button.basic.js
  3. 1
      src/base/single/label/abstract.label.js
  4. 11
      src/base/single/text.js

38
src/base/single/__test__/text.test.js

@ -154,4 +154,42 @@ describe("TextTest", function () {
done(); done();
}); });
}); });
/**
* test_author_windy
*/
it("text的value属性", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: "",
value: "aaaa"
});
expect(text.element.text()).to.equal("");
text.destroy();
});
/**
* test_author_windy
*/
it("text的value属性1", function () {
var text = BI.Test.createWidget({
type: "bi.text",
value: "aaaa"
});
expect(text.element.text()).to.equal("aaaa");
text.destroy();
});
/**
* test_author_windy
*/
it("text的value属性2", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: null,
value: "aaaa"
});
expect(text.element.text()).to.equal("");
text.destroy();
});
}); });

1
src/base/single/button/button.basic.js

@ -11,7 +11,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
return BI.extend(conf, { return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""), _baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "", value: "",
text: "",
stopEvent: false, stopEvent: false,
stopPropagation: false, stopPropagation: false,
selected: false, selected: false,

1
src/base/single/label/abstract.label.js

@ -17,7 +17,6 @@
rgap: 0, rgap: 0,
tgap: 0, tgap: 0,
bgap: 0, bgap: 0,
text: "",
highLight: false, highLight: false,
handler: null handler: null
}); });

11
src/base/single/text.js

@ -18,7 +18,6 @@
rgap: 0, rgap: 0,
tgap: 0, tgap: 0,
bgap: 0, bgap: 0,
text: "",
py: "", py: "",
highLight: false highLight: false
}, },
@ -78,8 +77,10 @@
} }
var text = this._getShowText(); var text = this._getShowText();
if (BI.isKey(text)) { if (!BI.isUndefined(text)) {
this.setText(text); this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
} }
if (BI.isKey(o.keyword)) { if (BI.isKey(o.keyword)) {
this.doRedMark(o.keyword); this.doRedMark(o.keyword);
@ -103,10 +104,8 @@
_getShowText: function () { _getShowText: function () {
var o = this.options; var o = this.options;
var text = BI.isFunction(o.text) ? o.text() : o.text; var text = BI.isFunction(o.text) ? o.text() : o.text;
if (!BI.isKey(text)) {
return ""; return BI.isKey(text) ? BI.Text.formatText(text + "") : text;
}
return BI.Text.formatText(text + "");
}, },
_doRedMark: function (keyword) { _doRedMark: function (keyword) {

Loading…
Cancel
Save