Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/js/bstreeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
treeviewItem: '<div role="treeitem" class="list-group-item" data-bs-toggle="collapse"></div>',
treeviewGroupItem: '<div role="group" class="list-group collapse" id="itemid"></div>',
treeviewItemStateIcon: '<i class="state-icon"></i>',
treeviewItemIcon: '<i class="item-icon"></i>'
treeviewItemIcon: '<i class="item-icon"></i>',
treeviewItemEmptyIcon: '<i class="fa fa-fw"></i>'
};
/**
* BsTreeview Plugin constructor.
Expand Down Expand Up @@ -82,8 +83,7 @@
window.location = e.target.getAttribute('href');
}
}
else
{
else {
// Toggle the data-bs-target. Issue with Bootstrap toggle and dynamic code
$($(this).attr("data-bs-target")).collapse('toggle');
}
Expand Down Expand Up @@ -133,8 +133,11 @@
// Set Expand and Collapse icones.
if (node.nodes) {
var treeItemStateIcon = $(templates.treeviewItemStateIcon)
.addClass((node.expanded)?_this.settings.expandIcon:_this.settings.collapseIcon);
.addClass((node.expanded) ? _this.settings.expandIcon : _this.settings.collapseIcon);
treeItem.append(treeItemStateIcon);
} else {
var treeItemEmptyIcon = $(templates.treeviewItemEmptyIcon);
treeItem.append(treeItemEmptyIcon);
}
// set node icon if exist.
if (node.icon) {
Expand Down