From afcf31d34d9185fc9c771be5dfe9ca270becf024 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Mon, 14 Dec 2015 09:52:58 +0000 Subject: [PATCH] feat(api-list): also filter by module title Closes #433 --- public/resources/js/directives/api-list.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/resources/js/directives/api-list.js b/public/resources/js/directives/api-list.js index 621d0526b2..0f8cfea511 100644 --- a/public/resources/js/directives/api-list.js +++ b/public/resources/js/directives/api-list.js @@ -50,10 +50,11 @@ angularIO.directive('apiList', function () { function(filter, type, sections) { $ctrl.filteredSections.length = 0; angular.forEach($ctrl.sections, function(section, title) { + var matchesModule = $ctrl.apiFilter == '' || title.toLowerCase().indexOf($ctrl.apiFilter.toLowerCase()) !== -1; var filteredItems = section.filter(function(item) { var matchesDocType = !$ctrl.apiType || $ctrl.apiType.matches.indexOf(item.docType) !== -1; var matchesTitle = $ctrl.apiFilter == '' || item.title.toLowerCase().indexOf($ctrl.apiFilter.toLowerCase()) !== -1; - return matchesDocType && matchesTitle; + return matchesDocType && (matchesTitle || matchesModule); }); if (filteredItems.length) { $ctrl.filteredSections.push({ title: title, items: filteredItems });