Skip to content

Commit 42e8c4a

Browse files
Eric JimenezEric Jimenez
Eric Jimenez
authored and
Eric Jimenez
committed
feat(filter stable): filter by stability stable
1 parent 3db8642 commit 42e8c4a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

public/resources/js/directives/api-list.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ angularIO.directive('apiList', function () {
2727
var $ctrl = this;
2828

2929
$ctrl.apiTypes = [
30+
{ cssClass: 'stable', title: 'Stable', matches: ['stable']},
3031
{ cssClass: 'directive', title: 'Directive', matches: ['directive'] },
3132
{ cssClass: 'decorator', title: 'Decorator', matches: ['decorator'] },
3233
{ cssClass: 'class', title: 'Class', matches: ['class'] },
@@ -51,6 +52,16 @@ angularIO.directive('apiList', function () {
5152
var isVisible = false;
5253

5354
section.items.forEach(function(item) {
55+
56+
// Filter by stability (ericjim: only 'stable' for now)
57+
if ($ctrl.apiType && $ctrl.apiType.matches.length === 1 &&
58+
$ctrl.apiType.matches[0] === 'stable' && item.stability === 'stable') {
59+
item.show = true;
60+
isVisible = true;
61+
return isVisible;
62+
} // NOTE: other checks can be performed for stability (experimental, deprecated, etc)
63+
64+
// Filter by docType
5465
var matchesDocType = !$ctrl.apiType || $ctrl.apiType.matches.indexOf(item.docType) !== -1;
5566
var matchesTitle = !apiFilter || item.title.toLowerCase().indexOf(apiFilter) !== -1;
5667
item.show = matchesDocType && (matchesTitle || matchesModule);

0 commit comments

Comments
 (0)