Skip to content

Commit a697d68

Browse files
upgrade Font-Awsome from 3 to 4
1 parent fc37c23 commit a697d68

10 files changed

+33
-22
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ But there are other attributes to customize the tree:
4545
initial-selection = "Vegetable">
4646
></abn-tree>
4747

48+
The example uses Font-Awesome 3, but Font-Awsome 4 also works.
49+
Use the following syntax:
50+
51+
icon-leaf = "fa fa-file"
52+
53+
( in general, use spaces to apply multiple classes to icon elements )
54+
4855

4956
The data to create the tree is defined in your controller, and could be as simple as this:
5057

dist/abn_tree_directive.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ module.directive('abnTree', function($timeout) {
1919
return void 0;
2020
};
2121
if (attrs.iconExpand == null) {
22-
attrs.iconExpand = 'icon-plus';
22+
attrs.iconExpand = 'fa fa-plus';
2323
}
2424
if (attrs.iconCollapse == null) {
25-
attrs.iconCollapse = 'icon-minus';
25+
attrs.iconCollapse = 'fa fa-minus';
2626
}
2727
if (attrs.iconLeaf == null) {
28-
attrs.iconLeaf = 'icon-chevron-right';
28+
attrs.iconLeaf = 'fa fa-file';
2929
}
3030
if (attrs.expandLevel == null) {
3131
attrs.expandLevel = '3';

src/abn_tree_directive.coffee

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ module.directive 'abnTree',($timeout)->
2020
return undefined
2121

2222

23-
# default values
24-
attrs.iconExpand ?= 'icon-plus'
25-
attrs.iconCollapse ?= 'icon-minus'
26-
attrs.iconLeaf ?= 'icon-chevron-right'
23+
# default values ( Font-Awesome 3 or 4 )
24+
attrs.iconExpand ?= 'fa fa-plus'
25+
attrs.iconCollapse ?= 'fa fa-minus'
26+
attrs.iconLeaf ?= 'fa fa-file'
2727
attrs.expandLevel ?= '3'
2828

2929
expand_level = parseInt attrs.expandLevel,10

src/abn_tree_directive.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/abn_tree_template.jade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ ul.nav.nav-list.nav-pills.nav-stacked.abn-tree
1010

1111
a(ng-click="user_clicks_branch(row.branch)")
1212

13+
//- i.fa.fa-plus
14+
15+
//- div(style='border:1px solid red;padding:10px;')
16+
//- span {{ row.tree_icon }}
1317
i.indented.tree-icon(
1418
ng-class="row.tree_icon"
1519
ng-click="row.branch.expanded = !row.branch.expanded"

test/bs2_ng115_test_page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<!---->
1111
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"></script>
1212
<!-- Font Awesome (optional)-->
13-
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
13+
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
1414
<!-- Live Reload ( for development )-->
1515
<script src="http://localhost:35729/livereload.js"></script>
1616
<!--/-->
@@ -56,7 +56,7 @@ <h4>Angular 1.1.5</h4>
5656
<tr>
5757
<td>
5858
<div style="width:250px;margin-left:100px;background:whitesmoke;border:1px solid lightgray;border-radius:5px;">
59-
<abn-tree tree-data="example_treedata" icon-leaf="icon-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
59+
<abn-tree tree-data="example_treedata" icon-leaf="fa fa-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
6060
</div>
6161
</td>
6262
<td style="padding:20px;vertical-align:top;">

test/bs2_ng120_test_page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.js"></script>
1212
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-animate.js"></script>
1313
<!-- Font Awesome (optional)-->
14-
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
14+
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
1515
<!-- Live Reload ( for development )-->
1616
<script src="http://localhost:35729/livereload.js"></script>
1717
<!--/-->
@@ -57,7 +57,7 @@ <h4>Angular 1.2.0-rc.3</h4>
5757
<tr>
5858
<td>
5959
<div style="width:250px;margin-left:100px;background:whitesmoke;border:1px solid lightgray;border-radius:5px;">
60-
<abn-tree tree-data="example_treedata" icon-leaf="icon-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
60+
<abn-tree tree-data="example_treedata" icon-leaf="fa fa-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
6161
</div>
6262
</td>
6363
<td style="padding:20px;vertical-align:top;">

test/bs3_ng115_test_page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<!---->
1111
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"></script>
1212
<!-- Font Awesome (optional)-->
13-
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
13+
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
1414
<!-- Live Reload ( for development )-->
1515
<script src="http://localhost:35729/livereload.js"></script>
1616
<!--/-->
@@ -56,7 +56,7 @@ <h4>Angular 1.1.5</h4>
5656
<tr>
5757
<td>
5858
<div style="width:250px;margin-left:100px;background:whitesmoke;border:1px solid lightgray;border-radius:5px;">
59-
<abn-tree tree-data="example_treedata" icon-leaf="icon-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
59+
<abn-tree tree-data="example_treedata" icon-leaf="fa fa-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
6060
</div>
6161
</td>
6262
<td style="padding:20px;vertical-align:top;">

test/bs3_ng120_test_page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.js"></script>
1212
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-animate.js"></script>
1313
<!-- Font Awesome (optional)-->
14-
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
14+
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
1515
<!-- Live Reload ( for development )-->
1616
<script src="http://localhost:35729/livereload.js"></script>
1717
<!--/-->
@@ -57,7 +57,7 @@ <h4>Angular 1.2.0-rc.3</h4>
5757
<tr>
5858
<td>
5959
<div style="width:250px;margin-left:100px;background:whitesmoke;border:1px solid lightgray;border-radius:5px;">
60-
<abn-tree tree-data="example_treedata" icon-leaf="icon-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
60+
<abn-tree tree-data="example_treedata" icon-leaf="fa fa-file" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith"></abn-tree>
6161
</div>
6262
</td>
6363
<td style="padding:20px;vertical-align:top;">

test/test_page.jade

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ html(ng-app='AbnTest')
2424

2525

2626
// Font Awesome (optional)
27-
link(href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css",rel="stylesheet")
27+
//- link(href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css",rel="stylesheet")
28+
link(href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css",rel="stylesheet")
29+
2830

2931
// Live Reload ( for development )
3032
script(src="http://localhost:35729/livereload.js")
@@ -48,8 +50,6 @@ html(ng-app='AbnTest')
4850
style="margin:20px"
4951
)
5052

51-
52-
5353
h2 angular-bootstrap-nav-tree
5454
table
5555
tr
@@ -92,7 +92,7 @@ html(ng-app='AbnTest')
9292
)
9393
abn-tree(
9494
tree-data = "example_treedata"
95-
icon-leaf = "icon-file"
95+
icon-leaf = "fa fa-file"
9696
on-select = "my_tree_handler(branch)"
9797
expand-level = "2"
9898
initial-selection = "Granny Smith"

0 commit comments

Comments
 (0)