Code cleanup con CodeMaid

This commit is contained in:
Samuele E. Locatelli
2020-09-11 12:45:52 +02:00
parent 831ad26bb0
commit 91ccb018af
293 changed files with 52598 additions and 50875 deletions
+20 -20
View File
@@ -35,7 +35,7 @@ function WebForm_AutoFocus(focusId) {
targetControl = document.all[focusId];
}
var focused = targetControl;
if (targetControl && (!WebForm_CanFocus(targetControl)) ) {
if (targetControl && (!WebForm_CanFocus(targetControl))) {
focused = WebForm_FindFirstFocusableChild(targetControl);
}
if (focused) {
@@ -56,33 +56,33 @@ function WebForm_CanFocus(element) {
if (!element || !(element.tagName)) return false;
var tagName = element.tagName.toLowerCase();
return (!(element.disabled) &&
(!(element.type) || element.type.toLowerCase() != "hidden") &&
WebForm_IsFocusableTag(tagName) &&
WebForm_IsInVisibleContainer(element)
);
(!(element.type) || element.type.toLowerCase() != "hidden") &&
WebForm_IsFocusableTag(tagName) &&
WebForm_IsInVisibleContainer(element)
);
}
function WebForm_IsFocusableTag(tagName) {
return (tagName == "input" ||
tagName == "textarea" ||
tagName == "select" ||
tagName == "button" ||
tagName == "a");
tagName == "textarea" ||
tagName == "select" ||
tagName == "button" ||
tagName == "a");
}
function WebForm_IsInVisibleContainer(ctrl) {
var current = ctrl;
while((typeof(current) != "undefined") && (current != null)) {
while ((typeof (current) != "undefined") && (current != null)) {
if (current.disabled ||
( typeof(current.style) != "undefined" &&
( ( typeof(current.style.display) != "undefined" &&
current.style.display == "none") ||
( typeof(current.style.visibility) != "undefined" &&
current.style.visibility == "hidden") ) ) ) {
(typeof (current.style) != "undefined" &&
((typeof (current.style.display) != "undefined" &&
current.style.display == "none") ||
(typeof (current.style.visibility) != "undefined" &&
current.style.visibility == "hidden")))) {
return false;
}
if (typeof(current.parentNode) != "undefined" &&
current.parentNode != null &&
current.parentNode != current &&
current.parentNode.tagName.toLowerCase() != "body") {
if (typeof (current.parentNode) != "undefined" &&
current.parentNode != null &&
current.parentNode != current &&
current.parentNode.tagName.toLowerCase() != "body") {
current = current.parentNode;
}
else {
@@ -90,4 +90,4 @@ function WebForm_IsInVisibleContainer(ctrl) {
}
}
return true;
}
}