Skip to content

Commit

Permalink
Fix getNamespace() and show protected methods in Polymer 1.x (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelli authored and aomarks committed Jun 27, 2017
1 parent 7e75aeb commit 70bfdeb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions iron-doc-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h2>
</iron-doc-function>
</template>

<template is="dom-if" if="[[_protectedCount(descriptor.methods, descriptor.staticMethods)]]">
<template is="dom-if" if="[[_protectedCount(descriptor.methods, _staticMethods)]]">
<template is="dom-if" if="[[_showProtectedMethods]]">
<template is="dom-repeat"
items="[[_protected(descriptor.staticMethods)]]"
Expand All @@ -104,7 +104,7 @@ <h2>
</template>

<iron-doc-hide-bar visible="{{_showProtectedMethods}}">
[[_protectedCount(descriptor.methods, descriptor.staticMethods)]]
[[_protectedCount(descriptor.methods, _staticMethods)]]
protected methods
</iron-doc-hide-bar>
</template>
Expand Down Expand Up @@ -153,7 +153,11 @@ <h2>
properties: {
_showProtectedProperties: Boolean,
_showProtectedMethods: Boolean,
_showProtectedEvents: Boolean
_showProtectedEvents: Boolean,

_staticMethods: {
computed: '_computeStaticMethods(descriptor)'
}
},

_anyVisible: function(items) {
Expand Down Expand Up @@ -194,7 +198,11 @@ <h2>
sum += this._protected(arguments[i]).length
}
return sum;
}
},

_computeStaticMethods: function(descriptor) {
return descriptor.staticMethods || [];
},
});
})();
</script>
Expand Down
6 changes: 3 additions & 3 deletions iron-doc-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,18 +361,18 @@
parts = parts.slice(0, parts.length - 1);
var namespace = descriptor;

parts.forEach(function(part) {
for (var i = 0; i < parts.length; i++) {
if (!namespace.namespaces) {
return undefined;
}
var matches = namespace.namespaces.filter(function(n) {
return n.name === part;
return n.name === parts[i];
});
if (matches.length === 0) {
return undefined;
}
namespace = matches[0];
});
};
return namespace;
}
})();
Expand Down

0 comments on commit 70bfdeb

Please sign in to comment.