forked from I2P_Developers/i2p.i2p
Improve toggle behavior
This commit is contained in:
@ -15,34 +15,27 @@ hideableTables.forEach(function(configTable) {
|
|||||||
var collapseme = false;
|
var collapseme = false;
|
||||||
for (var i = 0, row; (row = configTable.offsetParent.rows[i]); i++) {
|
for (var i = 0, row; (row = configTable.offsetParent.rows[i]); i++) {
|
||||||
var l = lookupTableRow();
|
var l = lookupTableRow();
|
||||||
if (i > l) {
|
if (i >= l) {
|
||||||
if (collapseme) {
|
if (row.classList.contains("tunnelConfigExpanded")) {
|
||||||
if (row.firstElementChild.localName != "th") {
|
|
||||||
if (
|
|
||||||
!row.firstElementChild.classList.contains("buttons")
|
|
||||||
) {
|
|
||||||
row.style.visibility = "collapse";
|
row.style.visibility = "collapse";
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (row.style.visibility == "visible") {
|
|
||||||
if (row.firstElementChild.localName != "th") {
|
|
||||||
if (
|
|
||||||
!row.firstElementChild.classList.contains("buttons")
|
|
||||||
) {
|
|
||||||
row.style.visibility = "collapse";
|
|
||||||
collapseme = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
row.querySelectorAll("th").forEach(function(configRow) {
|
row.querySelectorAll("th").forEach(function(configRow) {
|
||||||
configRow.classList.toggle('tunnelConfigExpanded');
|
configRow.classList.remove('tunnelConfigExpanded');
|
||||||
|
configRow.parentElement.style.visiblity = "visible"
|
||||||
|
});
|
||||||
|
row.querySelectorAll(".buttons").forEach(function(configRow) {
|
||||||
|
configRow.classList.remove('tunnelConfigExpanded');
|
||||||
|
configRow.parentElement.style.visiblity = "visible"
|
||||||
});
|
});
|
||||||
configTable.classList.remove('tunnelConfigExpanded');
|
configTable.classList.remove('tunnelConfigExpanded');
|
||||||
|
row.classList.remove('tunnelConfigExpanded');
|
||||||
} else {
|
} else {
|
||||||
row.style.visibility = "visible";
|
row.style.visibility = "visible";
|
||||||
row.querySelectorAll("th").forEach(function(configRow) {
|
row.querySelectorAll("th").forEach(function(configRow) {
|
||||||
configRow.classList.add('tunnelConfigExpanded');
|
configRow.classList.add('tunnelConfigExpanded');
|
||||||
});
|
});
|
||||||
configTable.classList.add('tunnelConfigExpanded');
|
configTable.classList.add('tunnelConfigExpanded');
|
||||||
|
row.classList.add('tunnelConfigExpanded')
|
||||||
|
row.classList.add('excludeBackgroundImage')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -52,6 +45,16 @@ hideableTables.forEach(function(configTable) {
|
|||||||
if (row.firstElementChild.localName != "th") {
|
if (row.firstElementChild.localName != "th") {
|
||||||
if (!row.firstElementChild.classList.contains("buttons")) {
|
if (!row.firstElementChild.classList.contains("buttons")) {
|
||||||
row.style.visibility = "collapse";
|
row.style.visibility = "collapse";
|
||||||
|
row.querySelectorAll("th").forEach(function(configRow) {
|
||||||
|
configRow.classList.remove('tunnelConfigExpanded');
|
||||||
|
configRow.parentElement.style.visiblity = "visible"
|
||||||
|
});
|
||||||
|
row.querySelectorAll(".buttons").forEach(function(configRow) {
|
||||||
|
configRow.classList.remove('tunnelConfigExpanded');
|
||||||
|
configRow.parentElement.style.visiblity = "visible"
|
||||||
|
});
|
||||||
|
configTable.classList.remove('tunnelConfigExpanded');
|
||||||
|
row.classList.remove('tunnelConfigExpanded');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user