diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-27 12:42:48 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-27 12:42:48 -0400 |
| commit | 210e8feae2fb4842bfb2de38666e6c41671fef3c (patch) | |
| tree | cbdafa34b1a6260bb20236d7e9de9eb1b690a1c5 /www/lib/vis/docs/js/toggleTable.js | |
| parent | e7e7baeaad90229ccb3e0f45f4ebd77be7d79b14 (diff) | |
removed lib
Diffstat (limited to 'www/lib/vis/docs/js/toggleTable.js')
| -rw-r--r-- | www/lib/vis/docs/js/toggleTable.js | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/www/lib/vis/docs/js/toggleTable.js b/www/lib/vis/docs/js/toggleTable.js deleted file mode 100644 index 6fbe9f6d..00000000 --- a/www/lib/vis/docs/js/toggleTable.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Created by Alex on 4/21/2015. - */ - -/** - * it works like this: - * - * the toggle row has the onclick with the table id, the parent name and this. The function will look through all trs with matching parent and check the class - * if hidden, it shows them, else it hides them. - * - * The caret is also flipped and the toggle class is changed. - * - * - <tr class='toggle collapsible' onclick="toggleTable('physicsTable','barnesHut', this);"><td><span parent="barnesHut" class="right-caret"></span> barnesHut</td></tr> - <tr parent="barnesHut" class="hidden"><td>barnesHut.gravitationalConstant</td></tr> - <tr parent="barnesHut" class="hidden"><td>barnesHut.centralGravity</td></tr> - <tr parent="barnesHut" class="hidden"><td>barnesHut.springLength</td></tr> - <tr parent="barnesHut" class="hidden"><td>barnesHut.springConstant</td></tr> - <tr parent="barnesHut" class="hidden"><td>barnesHut.damping</td></tr> - * - * - * @param tableId - * @param parent - * @param clickedRow - */ -function toggleTable(tableId, parent, clickedRow) { - var table = document.getElementById(tableId); - var wasOpen = false; - for (var i = 0, row; row = table.rows[i]; i++) { - if (row.getAttribute('parent') === parent) { - if (row.className.indexOf('hidden') !== -1) { - row.className = row.className.replace(' hidden','').replace('hidden',''); - row.className += ' visible'; - } - else { - row.className = row.className.replace(' visible','').replace('visible','');; - row.className += ' hidden'; - wasOpen = true; - } - } - } - - var spans; - if (wasOpen === true) { - spans = document.getElementsByClassName('caret'); - clickedRow.className += ' collapsible'; - } - else { - spans = document.getElementsByClassName('right-caret') - clickedRow.className = clickedRow.className.replace(' collapsible','').replace('collapsible','');; - } - - for (var i = 0; i < spans.length; i++) { - if (spans[i].getAttribute('parent') === parent) { - spans[i].className = wasOpen === true ? 'right-caret' : 'caret'; - } - } -} - -function toggleTab(tabThis) { - var parentNode = tabThis.parentNode; - var active = tabThis.className.indexOf('active') !== -1; - for (var i = 0; i < parentNode.children.length; i++) { - var child = parentNode.children[i]; - var targetNodeId = child.getAttribute('targetNode'); - if (targetNodeId) { - var targetNode = document.getElementById(child.getAttribute('targetNode')); - targetNode.className = targetNode.className.replace(' hidden', '').replace('hidden', '') + ' hidden'; - } - child.className = child.className.replace(' active','').replace('active',''); - } - - // activate the tab - tabThis.className += ' active'; - var ownTargetNodeId = tabThis.getAttribute('targetNode'); - if (ownTargetNodeId) { - var ownTargetNode = document.getElementById(ownTargetNodeId); - ownTargetNode.className = ownTargetNode.className.replace(' hidden','').replace('hidden',''); - } - -}
\ No newline at end of file |
