Browse Source

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

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

* commit '6f0e701f5c5846d6d599774109337705ea8b0c69':
  bugfix
es6
guy 4 years ago
parent
commit
4e30e3adf3
  1. 8
      src/base/single/text.js
  2. 13
      src/base/tree/ztree/treeview.js

8
src/base/single/text.js

@ -144,13 +144,15 @@ BI.Text = BI.inherit(BI.Single, {
// 为textContext赋值为undefined时在ie和edge下会真的显示undefined // 为textContext赋值为undefined时在ie和edge下会真的显示undefined
this.options.text = BI.isNotNull(text) ? text : ""; this.options.text = BI.isNotNull(text) ? text : "";
if (BI.isIE9Below()) { if (BI.isIE9Below()) {
this.text.element.html(BI.htmlEncode(this._getShowText())); this.text.element.html(BI.htmlEncode(BI.Text.formatText(this._getShowText())));
return; return;
} }
// textContent性能更好,并且原生防xss // textContent性能更好,并且原生防xss
this.text.element[0].textContent = 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) {
return text;
};
BI.shortcut("bi.text", BI.Text); BI.shortcut("bi.text", BI.Text);

13
src/base/tree/ztree/treeview.js

@ -32,7 +32,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this, element: this,
items: [this.tip] items: [this.tip]
}); });
if(BI.isNotNull(o.value)) { if (BI.isNotNull(o.value)) {
this.setSelectedValue(o.value); this.setSelectedValue(o.value);
} }
if (BI.isIE9Below && BI.isIE9Below()) { if (BI.isIE9Below && BI.isIE9Below()) {
@ -111,7 +111,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked; var checked = treeNode.checked;
var status = treeNode.getCheckStatus(); var status = treeNode.getCheckStatus();
if(status.half === true && status.checked === true) { if (status.half === true && status.checked === true) {
checked = false; checked = false;
} }
// 更新此node的check状态, 影响父子关联,并调用beforeCheck和onCheck回调 // 更新此node的check状态, 影响父子关联,并调用beforeCheck和onCheck回调
@ -204,7 +204,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
}); });
} }
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
if(status.half === true && status.checked === true) { if (status.half === true && status.checked === true) {
treeNode.checked = false; treeNode.checked = false;
} }
} }
@ -333,11 +333,12 @@ BI.TreeView = BI.inherit(BI.Pane, {
BI.each(ns, function (i, n) { BI.each(ns, function (i, n) {
n.title = n.title || n.text || n.value; n.title = n.title || n.text || n.value;
n.isParent = n.isParent || n.parent; n.isParent = n.isParent || n.parent;
n.value = n.value || n.text;
// 处理标红 // 处理标红
if (BI.isKey(o.paras.keyword)) { if (BI.isKey(o.paras.keyword)) {
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html(); n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html();
} else { } else {
n.text = BI.htmlEncode(n.text + ""); n.text = BI.htmlEncode(BI.Text.formatText(n.text + ""));
} }
}); });
return nodes; return nodes;
@ -535,4 +536,4 @@ BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
BI.TreeView.EVENT_INIT = BI.Events.INIT; BI.TreeView.EVENT_INIT = BI.Events.INIT;
BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT; BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT;
BI.shortcut("bi.tree_view", BI.TreeView); BI.shortcut("bi.tree_view", BI.TreeView);

Loading…
Cancel
Save