diff --git a/subnets.html b/subnets.html index 4dc12fe..95bab65 100644 --- a/subnets.html +++ b/subnets.html @@ -109,7 +109,7 @@ function createBookmarkHyperlink() { link.href = '?network='+inet_ntoa(curNetwork) +'&mask='+curMask +'&division='+binToAscii(nodeToString(rootSubnet)) - +'&comments='+encodeURIComponent(JSON.stringify(curComments)); + +(Object.keys(curComments).length > 0 ? '&comments='+encodeURIComponent(JSON.stringify(curComments)) : ""); } } @@ -435,6 +435,7 @@ function calcOnLoad() document.forms['calc'].elements['netbits'].value = args['mask']; if (args['comments']) { + clickElement('cb_comments'); curComments = JSON.parse(args['comments']); } else { curComments = {}; @@ -492,21 +493,21 @@ function toggleColumn(cb) var cssName = '--display-'+(cb.id.substr(3)); if (cb.checked) { - enableColumn(cssName); + document.documentElement.style.setProperty(cssName, 'table-cell'); } else { - disableColumn(cssName); + document.documentElement.style.setProperty(cssName, 'none'); } recreateTables(); /* because IE draws lines all over the place with border-collapse */ } -function enableColumn(cssName) { - document.documentElement.style.setProperty(cssName, null); -} - -function disableColumn(cssName) { - document.documentElement.style.setProperty(cssName, 'none'); +function clickElement(id) { + document.getElementById(id).dispatchEvent(new MouseEvent('click', { + view: window, + bubbles: true, + cancelable: true + })) } //--> @@ -520,7 +521,7 @@ function disableColumn(cssName) { --display-range: table-cell; --display-useable: table-cell; --display-hosts: table-cell; - --display-comments: table-cell; + --display-comments: none; --display-divide: table-cell; --display-join: table-cell; } @@ -622,14 +623,14 @@ P {
Show columns: - - - - - - - - + + + + + + + +