@joyzl/eno 1.2.8 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -852,7 +852,13 @@ function getEntity(element, entity, converter) {
|
|
852
852
|
} else {
|
853
853
|
setValue(entity, name, element.innerText);
|
854
854
|
}
|
855
|
+
} else {
|
856
|
+
if (element.disabled) {
|
857
|
+
// 阻止禁用标签元素的子元素处理
|
858
|
+
return;
|
859
|
+
}
|
855
860
|
}
|
861
|
+
|
856
862
|
if (element.childElementCount) {
|
857
863
|
for (let i = 0; i < element.children.length; i++) {
|
858
864
|
getEntity(element.children[i], entity, converter);
|
@@ -886,9 +892,13 @@ function setEntity(element, entity, converter) {
|
|
886
892
|
// 默认处理
|
887
893
|
if (element.type) {
|
888
894
|
// 所有控件具有type属性
|
895
|
+
// 设置时不考虑disabled状态
|
889
896
|
if (element.type === "checkbox" || element.type === "radio") {
|
890
897
|
// Radio / Check
|
891
898
|
element.checked = element.value == value;
|
899
|
+
} else
|
900
|
+
if (element.type === "fieldset") {
|
901
|
+
//忽略
|
892
902
|
} else {
|
893
903
|
// OTHER
|
894
904
|
element.value = value;
|
@@ -1150,7 +1160,7 @@ function target(event, name, value) {
|
|
1150
1160
|
}
|
1151
1161
|
} else {
|
1152
1162
|
while (element && element !== event.currentTarget) {
|
1153
|
-
if (element.
|
1163
|
+
if (element.hasAttribute(name)) {
|
1154
1164
|
return element.getAttribute(name);
|
1155
1165
|
}
|
1156
1166
|
element = element.parentElement;
|