Permalink
Browse files

validating children property of element (Internet Explorer bug on SVG…

… elements)
  • Loading branch information...
felipevex committed Oct 18, 2018
1 parent 6eff141 commit f1c43b909957c07989432595b17d4033166890c3
Showing with 13 additions and 7 deletions.
  1. +13 −7 helper/browser/DomHelper.hx
@@ -16,17 +16,21 @@ class DomHelper {
el.setAttribute("disabled", "disabled");
for (i in 0 ... el.children.length) {
disableAll(el.children.item(i));
if (el.children != null) {
for (i in 0 ... el.children.length) {
disableAll(el.children.item(i));
}
}
}
public static function enableAllUpPrioriDisabled(el:Element):Void {
if (!el.hasAttribute("priori-disabled")) {
el.removeAttribute("disabled");
for (i in 0 ... el.children.length) {
enableAllUpPrioriDisabled(el.children.item(i));
if (el.children != null) {
for (i in 0 ... el.children.length) {
enableAllUpPrioriDisabled(el.children.item(i));
}
}
}
}
@@ -35,9 +39,11 @@ class DomHelper {
if (el == seekChild) return true;
else
for (i in 0 ... el.children.length) {
if (hasChild(el.children.item(i), seekChild)) {
return true;
if (el.children != null) {
for (i in 0 ... el.children.length) {
if (hasChild(el.children.item(i), seekChild)) {
return true;
}
}
}

0 comments on commit f1c43b9

Please sign in to comment.