diff --git a/public/resources/js/directives/api-list.js b/public/resources/js/directives/api-list.js index 98d41ef366..7be1c88d6d 100644 --- a/public/resources/js/directives/api-list.js +++ b/public/resources/js/directives/api-list.js @@ -27,6 +27,7 @@ angularIO.directive('apiList', function () { var $ctrl = this; $ctrl.apiTypes = [ + { cssClass: 'stable', title: 'Stable', matches: ['stable']}, { cssClass: 'directive', title: 'Directive', matches: ['directive'] }, { cssClass: 'decorator', title: 'Decorator', matches: ['decorator'] }, { cssClass: 'class', title: 'Class', matches: ['class'] }, @@ -51,6 +52,16 @@ angularIO.directive('apiList', function () { var isVisible = false; section.items.forEach(function(item) { + + // Filter by stability (ericjim: only 'stable' for now) + if ($ctrl.apiType && $ctrl.apiType.matches.length === 1 && + $ctrl.apiType.matches[0] === 'stable' && item.stability === 'stable') { + item.show = true; + isVisible = true; + return isVisible; + } // NOTE: other checks can be performed for stability (experimental, deprecated, etc) + + // Filter by docType var matchesDocType = !$ctrl.apiType || $ctrl.apiType.matches.indexOf(item.docType) !== -1; var matchesTitle = !apiFilter || item.title.toLowerCase().indexOf(apiFilter) !== -1; item.show = matchesDocType && (matchesTitle || matchesModule);