diff --git a/.gitignore b/.gitignore index a56a7ef..e8597c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules +.idea/ diff --git a/README.md b/README.md index 5d7c9bf..dc2b1bc 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Use the following syntax: The data to create the tree is defined in your controller, and could be as simple as this: - $scope.my_data = [{ + $scope.my_treedata = [{ label: 'Languages', children: ['Jade','Less','Coffeescript'] }] @@ -66,7 +66,7 @@ long-form, where is branch is an object, then you can also attach "data" to a br If you would like to add classes to a certain node, give it an array of classes like so: - $scope.my_data = [{ + $scope.my_treedata = [{ label: 'Languages', children: ['Jade','Less','Coffeescript'] classes: ["special", "red"] @@ -86,7 +86,7 @@ You can supply a single default "on-select" function for the whole tree -- it wi Or, you can put a custom "on-select" function on an individual branch: - $scope.my_data = [{ + $scope.my_treedata = [{ label: 'Languages', onSelect: function(branch){...}, children: ['Jade','Less','Coffeescript'] diff --git a/dist/abn_tree_directive.js b/dist/abn_tree_directive.js index f309995..6f820da 100644 --- a/dist/abn_tree_directive.js +++ b/dist/abn_tree_directive.js @@ -8,7 +8,7 @@ '$timeout', function($timeout) { return { restrict: 'E', - template: "", + template: "", replace: true, scope: { treeData: '=', diff --git a/package.json b/package.json index 17bfd85..45a0220 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,10 @@ { "name": "angular-bootstrap-nav-tree", "version": "0.2.0", + "repository":{ + "type":"git", + "url":"git://github.com/nickperkinslondon/angular-bootstrap-nav-tree" + }, "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", @@ -10,5 +14,5 @@ "grunt-string-replace": "~0.2.7" }, "keywords":["angularjs","bootstrap","tree","widget"], - "licence":"MIT" + "license":"MIT" } diff --git a/src/abn_tree_template.jade b/src/abn_tree_template.jade index bec2c02..f1afa52 100644 --- a/src/abn_tree_template.jade +++ b/src/abn_tree_template.jade @@ -2,7 +2,7 @@ ul.nav.nav-list.nav-pills.nav-stacked.abn-tree li.abn-tree-row( - ng-repeat='row in tree_rows | filter:{visible:true} track by row.branch.uid' + ng-repeat='row in tree_rows | filter:{visible:true} track by row.branch.uid || \'~\' + $index' ng-animate="'abn-tree-animate'" ng-class="'level-' + {{ row.level }} + (row.branch.selected ? ' active':'') + ' ' +row.classes.join(' ')" )