Skip to content

Commit 6535320

Browse files
Added noLeaf option. Solves Issue #30.
1 parent b197c76 commit 6535320

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ If you would like to add classes to a certain node, give it an array of classes
7474
classes: ["special", "red"]
7575
}]
7676

77-
Each element without children, or leaf, is automatically given a leaf class.
77+
Each element without children, or leaf, is automatically given a leaf class. If you would like to force certain nodes not to be leaves (won't get leaf class and will show expand/collapse icons), set noLeaf to true in a long-form listing like so:
78+
79+
{
80+
label: 'Coffeescript',
81+
noLeaf: true
82+
}
7883

7984
You can supply a single default "on-select" function for the whole tree -- it will be called whenever a branch is selected:
8085

dist/abn_tree_directive.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/abn_tree_directive.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ module.directive 'abnTree',['$timeout',($timeout)->
198198
# they will be rendered like:
199199
# <i class="icon-plus"></i>
200200
#
201-
if not branch.children or branch.children.length == 0
201+
if not branch.noLeaf and (not branch.children or branch.children.length == 0)
202202
tree_icon = attrs.iconLeaf
203203
branch.classes.push "leaf" if "leaf" not in branch.classes
204204
else

0 commit comments

Comments
 (0)