Skip to content

Commit 422b5a8

Browse files
committed
Fix expand/collapse directory icons in tree view
1 parent b276235 commit 422b5a8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

templates/html/dynsections.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ let dynsection = {
5757
toggleLevel : function(level) {
5858
$('table.directory tr').each(function() {
5959
const l = this.id.split('_').length-1;
60-
if (l<=level+1) {
60+
const i = $('#img'+this.id.substring(3));
61+
if (l<level+1) {
62+
i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
63+
$(this).show();
64+
} else if (l==level+1) {
65+
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
6166
$(this).show();
6267
} else {
6368
$(this).hide();
@@ -82,14 +87,17 @@ let dynsection = {
8287
if (childRows.filter(':first').is(':visible')===true) {
8388
// replace down arrow by right arrow for current row
8489
const currentRowSpans = currentRow.find("span");
90+
currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
8591
currentRowSpans.filter(".opened").removeClass("opened").addClass("closed");
8692
rows.filter("[id^=row_"+id+"]").hide(); // hide all children
8793
} else { // we are SHOWING
8894
// replace right arrow by down arrow for current row
8995
const currentRowSpans = currentRow.find("span");
96+
currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
9097
currentRowSpans.filter(".closed").removeClass("closed").addClass("opened");
9198
// replace down arrows by right arrows for child rows
9299
const childRowsSpans = childRows.find("span");
100+
childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
93101
childRowsSpans.filter(".opened").removeClass("opened").addClass("closed");
94102
childRows.show(); //show all children
95103
}

0 commit comments

Comments
 (0)