Skip to content

Commit

Permalink
Fix how exclude_inherited option filters out items
Browse files Browse the repository at this point in the history
  • Loading branch information
GMartigny committed Oct 17, 2023
1 parent 5682600 commit 42430ee
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tmpl/container.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
<?js } ?>

<?js
var classes = self.find({kind: 'class', memberof: doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}}) } );
var shouldExcludeInherited = { ...(self.excludeInherited ? { inherited: {isUndefined: true} } : {}) };
var classes = self.find({kind: 'class', memberof: doc.longname, ...shouldExcludeInherited } );
if (!isGlobalPage && classes && classes.length) {
?>
<h2 id="classes" class="subsection-title has-anchor">Classes</h2>
Expand All @@ -103,7 +104,7 @@
<?js } ?>

<?js
var interfaces = self.find({kind: 'interface', memberof: doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}})});
var interfaces = self.find({kind: 'interface', memberof: doc.longname, ...shouldExcludeInherited});
if (!isGlobalPage && interfaces && interfaces.length) {
?>
<h2 id="interfaces" class="subsection-title has-anchor">Interfaces</h2>
Expand All @@ -115,7 +116,7 @@
<?js } ?>

<?js
var mixins = self.find({kind: 'mixin', memberof: doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}})});
var mixins = self.find({kind: 'mixin', memberof: doc.longname, ...shouldExcludeInherited});
if (!isGlobalPage && mixins && mixins.length) {
?>
<h2 id="mixins" class="subsection-title has-anchor">Mixins</h2>
Expand All @@ -127,7 +128,7 @@
<?js } ?>

<?js
var namespaces = self.find({kind: 'namespace', memberof: doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}})});
var namespaces = self.find({kind: 'namespace', memberof: doc.longname, ...shouldExcludeInherited});
if (!isGlobalPage && namespaces && namespaces.length) {
?>
<h2 id="namespaces" class="subsection-title has-anchor">Namespaces</h2>
Expand All @@ -139,7 +140,7 @@
<?js } ?>

<?js
var members = self.find({kind: 'member', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}})});
var members = self.find({kind: 'member', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});

// symbols that are assigned to module.exports are not globals, even though they're not a memberof anything
if (isGlobalPage && members && members.length && members.forEach) {
Expand All @@ -157,7 +158,7 @@
<?js } ?>

<?js
var methods = self.find({kind: 'function', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}})});
var methods = self.find({kind: 'function', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
if (methods && methods.length && methods.forEach) {
?>
<h2 id="methods" class="subsection-title has-anchor">Methods</h2>
Expand All @@ -168,7 +169,7 @@
<?js } ?>

<?js
var typedefs = self.find({kind: 'typedef', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}})});
var typedefs = self.find({kind: 'typedef', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
if (typedefs && typedefs.length && typedefs.forEach) {
?>
<h2 id="type-definitions" class="subsection-title has-anchor">Type Definitions</h2>
Expand All @@ -188,7 +189,7 @@
<?js } ?>

<?js
var events = self.find({kind: 'event', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...(self.excludeInherited && {inherited: {'!is': self.excludeInherited}})});
var events = self.find({kind: 'event', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
if (events && events.length && events.forEach) {
?>
<h2 id="events" class="subsection-title has-anchor">Events</h2>
Expand Down

0 comments on commit 42430ee

Please sign in to comment.