$ctrl.filterSections = function()

in public/resources/js/directives/api-list.js [198:226]


      $ctrl.filterSections = function(section) {
        var showSection = false;

        section.items.forEach(function(item) {
          item.show = false;

          // CHECK IF TYPE IS NULL & STATUS, QUERY
          if (($ctrl.type === null) && statusSelected(item) && queryEntered(section, item)) {
            item.show = true;
          }

          // CHECK IF TYPE IS SELECTED & STATUS, QUERY
          if (($ctrl.type === item.docType) && statusSelected(item) && queryEntered(section, item)) {
            item.show = true;
          }

          // CHECK IF TYPE IS CONST & STATUS, QUERY
          if (($ctrl.type === 'const') && isConst(item) && statusSelected(item) && queryEntered(section, item)) {
            item.show = true;
          }

          // SHOW SECTION IF ONE ITEM IS VISIBLE
          if(!showSection && item.show) {
            showSection = true;
          }
        });

        return showSection;
      }