summaryrefslogtreecommitdiffstats
path: root/src/dynsections_js.h
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2012-09-30 13:51:29 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2012-09-30 13:51:29 (GMT)
commitceb4115c7b941039411e1793e01239610ff112a2 (patch)
treed18c06222e0f84d6077b586e5633053a8bc09da8 /src/dynsections_js.h
parentf6d511e52eb55c5d5b980c4d226f2ea80b396095 (diff)
downloadDoxygen-ceb4115c7b941039411e1793e01239610ff112a2.zip
Doxygen-ceb4115c7b941039411e1793e01239610ff112a2.tar.gz
Doxygen-ceb4115c7b941039411e1793e01239610ff112a2.tar.bz2
Release-1.8.2-20120930
Diffstat (limited to 'src/dynsections_js.h')
-rw-r--r--src/dynsections_js.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/src/dynsections_js.h b/src/dynsections_js.h
index c2f5767..c2fba04 100644
--- a/src/dynsections_js.h
+++ b/src/dynsections_js.h
@@ -44,24 +44,43 @@
" });\n"
" updateStripes();\n"
"}\n"
-"function toggleFolder(id) \n"
+"\n"
+"function toggleFolder(id)\n"
"{\n"
-" var n = $('[id^=row_'+id+']');\n"
-" var i = $('[id^=img_'+id+']');\n"
-" var a = $('[id^=arr_'+id+']');\n"
-" var c = n.slice(1);\n"
-" if (c.filter(':first').is(':visible')===true) {\n"
-" i.attr('src','ftv2folderclosed.png');\n"
-" a.attr('src','ftv2pnode.png');\n"
-" c.hide();\n"
-" } else {\n"
-" i.attr('src','ftv2folderopen.png');\n"
-" a.attr('src','ftv2mnode.png');\n"
-" c.show();\n"
+" //The clicked row\n"
+" var currentRow = $('#row_'+id);\n"
+" var currentRowImages = currentRow.find(\"img\");\n"
+"\n"
+" //All rows after the clicked row\n"
+" var rows = currentRow.nextAll(\"tr\");\n"
+"\n"
+" //Only match elements AFTER this one (can't hide elements before)\n"
+" var childRows = rows.filter(function() {\n"
+" var re = new RegExp('^row_'+id+'\\\\d+_$', \"i\"); //only one sub\n"
+" return this.id.match(re);\n"
+" });\n"
+"\n"
+" //First row is visible we are HIDING\n"
+" if (childRows.filter(':first').is(':visible')===true) {\n"
+" currentRowImages.filter(\"[id^=arr]\").attr('src', 'ftv2pnode.png');\n"
+" currentRowImages.filter(\"[id^=img]\").attr('src', 'ftv2folderclosed.png');\n"
+" rows.filter(\"[id^=row_\"+id+\"]\").hide();\n"
+" } else { //We are SHOWING\n"
+" //All sub images\n"
+" var childImages = childRows.find(\"img\");\n"
+" var childImg = childImages.filter(\"[id^=img]\");\n"
+" var childArr = childImages.filter(\"[id^=arr]\");\n"
+"\n"
+" currentRow.find(\"[id^=arr]\").attr('src', 'ftv2mnode.png'); //open row\n"
+" currentRow.find(\"[id^=img]\").attr('src', 'ftv2folderopen.png'); //open row\n"
+" childImg.attr('src','ftv2folderclosed.png'); //children closed\n"
+" childArr.attr('src','ftv2pnode.png'); //children closed\n"
+" childRows.show(); //show all children\n"
" }\n"
" updateStripes();\n"
"}\n"
"\n"
+"\n"
"function toggleInherit(id)\n"
"{\n"
" var rows = $('tr.inherit.'+id);\n"