allow category selection by clicking anywhere on the row

This commit is contained in:
Athou
2013-05-02 12:11:46 +02:00
parent 12bd58c484
commit b411528ac7
2 changed files with 9 additions and 7 deletions

View File

@@ -186,7 +186,9 @@ module.directive('category', [ function() {
});
};
$scope.toggleCategory = function(category) {
$scope.toggleCategory = function(category, event) {
event.preventDefault();
event.stopPropagation();
category.expanded = !category.expanded;
if (category.id == 'all') {
return;

View File

@@ -5,14 +5,14 @@
<i ng-class="{'icon-wrench': hovered==node}" class="icon"></i>
</div>
</div>
<span class="fldr">
<i ng-class="{'icon-caret-right': !node.expanded, 'icon-caret-down': node.expanded}" ng-click="toggleCategory(node)" ng-show="showChildren"></i>
<i ng-class="{'icon-star' : node.id == 'starred', 'icon-inbox': node.id == 'all'}" ng-show="!showChildren"></i>
</span>
<span ng-click="categoryClicked(node.id)">
<div ng-click="categoryClicked(node.id)">
<span class="fldr">
<i ng-class="{'icon-caret-right': !node.expanded, 'icon-caret-down': node.expanded}" ng-click="toggleCategory(node, $event)" ng-show="showChildren"></i>
<i ng-class="{'icon-star' : node.id == 'starred', 'icon-inbox': node.id == 'all'}" ng-show="!showChildren"></i>
</span>
<span ng-class="{selected: (node.id == selectedId && selectedType == 'category'), unread: unreadCount({category:node})}">{{formatCategoryName(node)}}
</span>
</span>
</div>
</div>
<ul ng-show="node.expanded && showChildren">
<recursive>