Browse Source

Pull request #1334: 无JIRA任务 clear_editor也改取值方式

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

* commit 'dc7ae89908e88013da7381ac7e50659f4e448327':
  无JIRA任务 clear_editor也改取值方式
es6
windy 5 years ago
parent
commit
0fc432b0ec
  1. 18
      src/case/editor/__test__/editor.clear.test.js
  2. 3
      src/case/editor/editor.clear.js

18
src/case/editor/__test__/editor.clear.test.js

@ -89,4 +89,22 @@ describe("clear_editor", function () {
editor.destroy();
});
/**
* test_author_windy
*/
it("getValue1", function () {
var editor = BI.Test.createWidget({
type: "bi.clear_editor",
width: 300,
value: "12346 7890",
watermark: "添加合法性判断",
errorText: "长度必须大于4",
validationChecker: function () {
return this.getValue().length > 4;
}
});
expect(editor.getValue()).to.equal("12346 7890");
editor.destroy();
});
});

3
src/case/editor/editor.clear.js

@ -144,8 +144,7 @@ BI.ClearEditor = BI.inherit(BI.Widget, {
getValue: function () {
if (this.isValid()) {
var res = this.editor.getValue().match(/[\S]+/g);
return BI.isNull(res) ? "" : res[res.length - 1];
return this.editor.getValue();
}
},

Loading…
Cancel
Save