diff --git a/apps/i2ptunnel/jsp/js/tableSlider.js b/apps/i2ptunnel/jsp/js/tableSlider.js index 647c7adb6f..6185882fc7 100644 --- a/apps/i2ptunnel/jsp/js/tableSlider.js +++ b/apps/i2ptunnel/jsp/js/tableSlider.js @@ -3,19 +3,15 @@ function initTables() { var hideableTables = document.querySelectorAll("table.tunnelConfig th"); hideableTables.forEach(function(configTable) { - configTable.onclick = function() { - function lookupTableRow() { - for ( - var i = 0, row; - (row = configTable.offsetParent.rows[i]); - i++ - ) { - if (configTable.parentNode == row) { - return i; - } + function lookupTableRow() { + for (var i = 0, row; (row = configTable.offsetParent.rows[i]); i++) { + if (configTable.parentNode == row) { + return i; } - return -1; } + return -1; + } + configTable.onclick = function() { var collapseme = false; for (var i = 0, row; (row = configTable.offsetParent.rows[i]); i++) { var l = lookupTableRow(); @@ -27,6 +23,8 @@ hideableTables.forEach(function(configTable) { ) { row.style.visibility = "collapse"; } + } else { + row.firstElementChild.classList.remove('tunnelConfigExpanded'); } } else if (row.style.visibility == "visible") { if (row.firstElementChild.localName != "th") { @@ -35,14 +33,15 @@ hideableTables.forEach(function(configTable) { ) { row.style.visibility = "collapse"; collapseme = true; - configTable.classList.remove( - "tunnelConfigExpanded" - ); } + } else { + row.firstElementChild.classList.remove('tunnelConfigExpanded'); } } else { row.style.visibility = "visible"; - configTable.classList.add("tunnelConfigExpanded"); + if (row.firstElementChild.localName == 'th') { + row.firstElementChild.classList.add('tunnelConfigExpanded'); + } } } } @@ -57,6 +56,9 @@ hideableTables.forEach(function(configTable) { } for (var i = 0, row; (row = hideableTables[0].offsetParent.rows[i]); i++) { row.style.visibility = "visible"; + if (row.firstElementChild.localName == 'th') { + row.firstElementChild.classList.add('tunnelConfigExpanded'); + } } }); diff --git a/installer/resources/themes/console/dark/i2ptunnel.css b/installer/resources/themes/console/dark/i2ptunnel.css index 60babf78d1..dd5f1dcfda 100644 --- a/installer/resources/themes/console/dark/i2ptunnel.css +++ b/installer/resources/themes/console/dark/i2ptunnel.css @@ -353,7 +353,7 @@ html body#tunnelEditPage form div.panel table#serverTunnelEdit.tunnelConfig tbod .tunnelConfigExpanded { background: url(images/dropdown_active.png) #433e47 !important; - padding-left: 30px; + padding-left: 0px !important; } .tunnelConfigContracted { diff --git a/installer/resources/themes/console/light/i2ptunnel.css b/installer/resources/themes/console/light/i2ptunnel.css index 4fc9d60c4c..6bcfec8465 100644 --- a/installer/resources/themes/console/light/i2ptunnel.css +++ b/installer/resources/themes/console/light/i2ptunnel.css @@ -535,7 +535,7 @@ html body#tunnelEditPage form div.panel table#serverTunnelEdit.tunnelConfig tbod .excludeBackgroundImage { background-image: none !important; - padding-left: 30px; + padding-left: 0px !important; } .tunnelProperties {