added complete tree

This commit is contained in:
Athou
2013-03-22 22:11:40 +01:00
parent 31f6687b38
commit 87000b0e11
8 changed files with 128 additions and 115 deletions

View File

@@ -15,14 +15,12 @@ module.directive('category', function($compile) {
replace: true,
templateUrl: 'directives/category.html',
link: function(scope, element) {
if (scope.node.children) {
var ul = element.find('ul');
ul.prepend('<category ng-repeat="child in node.children" node="child" feed-click="feedClick({id:id})" \
category-click="categoryClick({id:id})" selected-type="selectedType" selected-id="selectedId" \
format-category-name="formatCategoryName({category:category})" format-feed-name="formatFeedName({feed:feed})">\
</category>');
$compile(ul.contents())(scope);
}
var ul = element.find('ul');
ul.prepend('<category ng-repeat="child in node.children" node="child" feed-click="feedClick({id:id})" \
category-click="categoryClick({id:id})" selected-type="selectedType" selected-id="selectedId" \
format-category-name="formatCategoryName({category:category})" format-feed-name="formatFeedName({feed:feed})">\
</category>');
$compile(ul.contents())(scope);
}
};
});

View File

@@ -3,23 +3,28 @@
<div class="span2" ng-controller="CategoryTreeCtrl">
<div class="css-treeview">
<ul>
<li ng-repeat="node in root.children">
<category node="node" feed-click="feedClicked(id)" category-click="categoryClicked(id)"
<category node="root" feed-click="feedClicked(id)" category-click="categoryClicked(id)"
selected-type="selectedType" selected-id="selectedId"
format-category-name="formatCategoryName(category)" format-feed-name="formatFeedName(feed)">
</category>
</li>
<!-- <li ng-repeat="node in root.children"> -->
<!-- <category node="node" feed-click="feedClicked(id)" category-click="categoryClicked(id)" -->
<!-- selected-type="selectedType" selected-id="selectedId" -->
<!-- format-category-name="formatCategoryName(category)" format-feed-name="formatFeedName(feed)"> -->
<!-- </category> -->
<!-- </li> -->
</ul>
</div>
</div>
<div class="span10" ng-controller="FeedListCtrl">
<span>{{entryList.name}}</span><span ng-show="selectedType == 'category'">&#187;</span>
<span>{{entryList.name}}</span><span ng-show="selectedType == 'category'"> &#187;</span>
<div class="accordion" id="feed-accordion">
<div class="accordion-group" ng-repeat="entry in entryList.entries">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" ng-click="markAsRead(entry)" ng-class="{unread: entry.read == false}"
data-parent="#feed-accordion" href="{{'#feed-body' + $index}}">
<span ng-show="selectedType == 'category'">{{entry.feedName}} - </span>{{entry.title}}
<span class="pull-right">{{entry.date}}</span>
</a>
</div>
<div id="{{'feed-body' + $index}}" class="accordion-body collapse">