Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
Fixes #457 and #461
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Jun 30, 2014
1 parent c96b663 commit 73c1a76
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<docs-menu unresolved
menu="{{site.data.pagetypes[page.type].menu}}"
coreElements='{% list_components dir:components prefix:core blacklist:"core-slide core-layout core-doc-viewer core-home-page" %}'
paperElements='{% list_components dir:components prefix:paper blacklist:"paper-calculator paper-doc-viewer paper-ink paper-scaffold"%}'>
coreElements='{% list_components dir:components prefix:core blacklist:"core-slide core-layout core-doc-viewer core-home-page core-transition-css core-overlay-layer core-key-helper" %}'
paperElements='{% list_components dir:components prefix:paper blacklist:"paper-calculator paper-doc-viewer paper-ink paper-scaffold paper-menu-button-transition"%}'>
</docs-menu>
</app-drawer>

Expand Down
2 changes: 1 addition & 1 deletion docs/elements/core-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ add_permalinks: false
</div>

<component-docs
elements='{% list_components dir:components prefix:core blacklist:"core-slide core-layout core-doc-viewer core-home-page" %}'>
elements='{% list_components dir:components prefix:core blacklist:"core-slide core-layout core-doc-viewer core-home-page core-transition-css core-overlay-layer core-key-helper" %}'>
</component-docs>
2 changes: 1 addition & 1 deletion docs/elements/paper-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ add_permalinks: false
</div>

<component-docs
elements='{% list_components dir:components prefix:paper blacklist:"paper-calculator paper-doc-viewer paper-ink paper-scaffold"%}'>
elements='{% list_components dir:components prefix:paper blacklist:"paper-calculator paper-doc-viewer paper-ink paper-scaffold paper-menu-button-transition"%}'>
</component-docs>

34 changes: 21 additions & 13 deletions elements/component-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

<polymer-element name="component-docs" attributes="elements">
<template>
<context-free-parser url="{{url}}" on-data-ready="{{dataReady}}"
data="{{data}}"></context-free-parser>
<template repeat="{{data.classes}}">
<doc-page id="{{name}}" name="{{name}}" data="{{}}"></doc-page>
<context-free-parser url="{{url}}" data="{{data}}" on-data-ready="{{dataReady}}">
</context-free-parser>
<template repeat="{{c in data.classes}}">
<doc-page id="{{c.name}}" name="{{c.name}}" data="{{c}}"
downloadable?="{{ isTopLevelElement(c.name, url) }}"></doc-page>
</template>
</template>
<script>
Expand All @@ -34,12 +35,15 @@
if (this.data.classes[0].name === 'Entity') {
this.data.classes[0].name = this.elementName;
}
},
isTopLevelElement: function(name, url) {
return url.indexOf('/components/' + name + '/') == 0;
}
});
</script>
</polymer-element>

<polymer-element name="doc-page" attributes="data" assetpath="../core-doc-viewer/elements/">
<polymer-element name="doc-page" attributes="data downloadable" assetpath="../core-doc-viewer/elements/">
<template>
<link rel="stylesheet" href="../components/highlightjs/styles/default.css">
<link rel="stylesheet" href="../css/elements/doc-page.css">
Expand All @@ -52,14 +56,17 @@ <h3>Extends: <a href="{{data.extends | collectionPrefix}}-elements.html#{{data.e
</section>
</template>

<p>
<component-download-button org="Polymer" component="{{data.name}}"
label="Get {{data.name}}"></component-download-button>
<a class="badge" target="_blank" href="/components/{{data.name}}/demo.html"
on-click="{{recordDemoPageview}}">
<paper-button label="Demo" raisedButton></paper-button>
</a>
</p>
<template if="{{downloadable}}">
<p>
<component-download-button id="downloadButton"
org="Polymer" component="{{data.name}}"
label="Get {{data.name}}"></component-download-button>
<a class="badge" target="_blank" href="/components/{{data.name}}/demo.html"
on-click="{{recordDemoPageview}}">
<paper-button label="Demo" raisedButton></paper-button>
</a>
</p>
</template>

<template if="{{data.description}}">
<section class="box top">
Expand Down Expand Up @@ -165,6 +172,7 @@ <h3>Methods</h3>
}

Polymer('doc-page', {
downloadable: false,
recordDemoPageview: function(e, detail, sender) {
window.recordPageview && window.recordPageview(sender.href); // global pollution.
},
Expand Down
2 changes: 1 addition & 1 deletion sass/elements/doc-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ pre {

.badge {
color: currentcolor;
}
}

0 comments on commit 73c1a76

Please sign in to comment.