Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Show expanding arrow if child array has items #314

Open
wants to merge 2 commits into
base: master
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
16 changes: 9 additions & 7 deletions src/js/bootstrap-treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,15 @@
// Add expand, collapse or empty spacer icons
var classList = [];
if (node.nodes) {
classList.push('expand-icon');
if (node.state.expanded) {
classList.push(_this.options.collapseIcon);
}
else {
classList.push(_this.options.expandIcon);
}
if (node.nodes.length > 0) {
classList.push('expand-icon');
if (node.state.expanded) {
classList.push(_this.options.collapseIcon);
}
else {
classList.push(_this.options.expandIcon);
}
}
}
else {
classList.push(_this.options.emptyIcon);
Expand Down