forked from Archives/Athou_commafeed
remember expanded state
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<li> <input type="checkbox" checked="checked" />
|
||||
<li> <input type="checkbox" ng-model="node.expanded" ng-click="toggleCategory(node)" />
|
||||
<label ng-click="categoryClick({id: node.id})"
|
||||
ng-class="{selected: (node.id == selectedId && selectedType == 'category')}">{{formatCategoryName({category:node})}}
|
||||
</label>
|
||||
|
||||
@@ -90,7 +90,15 @@ module.directive('category', function($compile) {
|
||||
.unsubscribe(subscription.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.toggleCategory = function(category) {
|
||||
console.log(category.expanded)
|
||||
SubscriptionService.collapse({
|
||||
id : category.id,
|
||||
collapse : !category.expanded
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -38,6 +38,12 @@ module.factory('SubscriptionService', [
|
||||
params : {
|
||||
_method : 'unsubscribe'
|
||||
}
|
||||
},
|
||||
collapse : {
|
||||
method : 'GET',
|
||||
params : {
|
||||
_method : 'collapse'
|
||||
}
|
||||
}
|
||||
};
|
||||
var s = {};
|
||||
@@ -84,6 +90,7 @@ module.factory('SubscriptionService', [
|
||||
id : id
|
||||
});
|
||||
};
|
||||
s.collapse = res.collapse;
|
||||
s.init();
|
||||
return s;
|
||||
} ]);
|
||||
|
||||
Reference in New Issue
Block a user