Skip to content

Commit 350887f

Browse files
committed
修复getButtonNode模式为button时,无论如何按钮都会被禁用的问题
1 parent 4feb0e3 commit 350887f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Template/Public/JavaScript/ControlNode.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
22
* @Date: 2020-04-29 10:13:23
33
* @LastEditors : MemoryShadow
4-
* @LastEditTime : 2021-01-06 20:13:22
4+
* @LastEditTime : 2021-01-07 13:07:51
55
* @Effect: 内置类ControlNode,用于控制节点,并包含一些内置的控件,可以快速创建
6+
* //!注:此类未完全完成,请勿用于生产环境
67
*/
78

89
/**
@@ -69,7 +70,7 @@ function ControlNode(MainNodeID) {
6970
}
7071

7172
/**
72-
* 用于索引自动管理的控件
73+
* 用于移除自动管理的控件
7374
* @param {int} Key 要删除的键
7475
* @return {HTMLElement} 被删除的节点控件
7576
*/
@@ -151,6 +152,9 @@ ControlNode.NewNode = function (NodeDescription) {
151152
// 处理选项信息,在这里额外处理
152153
node.checked = NodeDescription[Attributes_Name];
153154
break;
155+
case "Disabled":
156+
node.disabled = NodeDescription[Attributes_Name];
157+
break;
154158

155159
default:
156160
var AttributesObject = document.createAttribute(Attributes_Name);
@@ -270,7 +274,7 @@ ControlNode.getButtonNode = function (NodeDataType, Value, onClick, isDisable) {
270274
default:
271275
return JSON.parse(JSON.stringify({
272276
"Tag": "button",
273-
"Disabled": isDisable ? "disable" : "",
277+
"Disabled": isDisable ? "disable" : false,
274278
"OnClick": onClick,
275279
"Text": Value
276280
}));

0 commit comments

Comments
 (0)