Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions angular.treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
'<i class="expanded" data-ng-show="node.' + nodeChildren + '.length && !node.collapsed" data-ng-click="' + treeId + '.selectNodeHead(node)"></i>' +
'<i class="normal" data-ng-hide="node.' + nodeChildren + '.length"></i> ' +
'<span data-ng-class="node.selected" data-ng-click="' + treeId + '.selectNodeLabel(node)">{{node.' + nodeLabel + '}}</span>' +
'<div data-ng-hide="node.collapsed" data-tree-id="' + treeId + '" data-tree-model="node.' + nodeChildren + '" data-node-id=' + nodeId + ' data-node-label=' + nodeLabel + ' data-node-children=' + nodeChildren + '></div>' +
'</li>' +
'</ul>';
'<div data-ng-hide="node.collapsed" data-tree-id="'+treeId+'" data-tree-model="node.' + nodeChildren + '" data-node-id="' + nodeId +'" data-node-label="' + nodeLabel + '" data-node-children="' + nodeChildren + '"></div>' +
'</li>' +
'</ul>';


//check tree id, tree model
Expand All @@ -76,6 +76,9 @@
//if node label clicks,
scope[treeId].selectNodeLabel = scope[treeId].selectNodeLabel || function( selectedNode ){

//Collapse or Expand
selectedNode.collapsed = !selectedNode.collapsed;

//remove highlight from previous node
if( scope[treeId].currentNode && scope[treeId].currentNode.selected ) {
scope[treeId].currentNode.selected = undefined;
Expand Down
6 changes: 3 additions & 3 deletions css/angular.treeview.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ div[data-tree-model] li {

div[data-tree-model] li .expanded {
padding: 1px 10px;
background-image: url("../img/folder.png");
background-image: url("../img/sub.png");
background-repeat: no-repeat;
}

div[data-tree-model] li .collapsed {
padding: 1px 10px;
background-image: url("../img/folder-closed.png");
background-image: url("../img/add.png");
background-repeat: no-repeat;
}

Expand All @@ -50,7 +50,7 @@ div[data-tree-model] li i, div[data-tree-model] li span {
}

div[data-tree-model] li .selected {
background-color: #aaddff;
background-color: lightgrey;
font-weight: bold;
padding: 1px 5px;
}
Binary file added img/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/folder-closed.png
Binary file not shown.
Binary file removed img/folder.png
Binary file not shown.
Binary file added img/sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.