feat(filter stable): filter by stability stable
This commit is contained in:
parent
3db8642113
commit
42e8c4a10c
@ -27,6 +27,7 @@ angularIO.directive('apiList', function () {
|
|||||||
var $ctrl = this;
|
var $ctrl = this;
|
||||||
|
|
||||||
$ctrl.apiTypes = [
|
$ctrl.apiTypes = [
|
||||||
|
{ cssClass: 'stable', title: 'Stable', matches: ['stable']},
|
||||||
{ cssClass: 'directive', title: 'Directive', matches: ['directive'] },
|
{ cssClass: 'directive', title: 'Directive', matches: ['directive'] },
|
||||||
{ cssClass: 'decorator', title: 'Decorator', matches: ['decorator'] },
|
{ cssClass: 'decorator', title: 'Decorator', matches: ['decorator'] },
|
||||||
{ cssClass: 'class', title: 'Class', matches: ['class'] },
|
{ cssClass: 'class', title: 'Class', matches: ['class'] },
|
||||||
@ -51,6 +52,16 @@ angularIO.directive('apiList', function () {
|
|||||||
var isVisible = false;
|
var isVisible = false;
|
||||||
|
|
||||||
section.items.forEach(function(item) {
|
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 matchesDocType = !$ctrl.apiType || $ctrl.apiType.matches.indexOf(item.docType) !== -1;
|
||||||
var matchesTitle = !apiFilter || item.title.toLowerCase().indexOf(apiFilter) !== -1;
|
var matchesTitle = !apiFilter || item.title.toLowerCase().indexOf(apiFilter) !== -1;
|
||||||
item.show = matchesDocType && (matchesTitle || matchesModule);
|
item.show = matchesDocType && (matchesTitle || matchesModule);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user