-
-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
paper-button: Support <a>
tags with href and optional target attributes.
#372
Changes from 3 commits
0a10f89
f06764b
6db7f5c
011a805
551acbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,13 @@ | |
{{/paper-toolbar}} | ||
{{#paper-content class="md-padding demo-buttons"}} | ||
<div class="doc-content"> | ||
<p> | ||
<div layout="row" class="flex"> | ||
{{#paper-button onClick=(action "flatButton")}}Button with action{{/paper-button}} | ||
{{#paper-button noink=true primary=true}}Primary (noink){{/paper-button}} | ||
{{#paper-button disabled=true}}disabled{{/paper-button}} | ||
{{#paper-button warn=true}}warn{{/paper-button}} | ||
</p> | ||
{{#paper-button href="http://emberjs.com/images/tomsters/original.png" target="_blank"}}href link{{/paper-button}} | ||
</div> | ||
<p> | ||
{{#paper-button raised=true onClick=(action "raisedButton")}}Button with action{{/paper-button}} | ||
{{#paper-button raised=true primary=true}}Primary{{/paper-button}} | ||
|
@@ -37,12 +38,13 @@ | |
</p> | ||
<h3>Template</h3> | ||
{{#code-block language='handlebars'}} | ||
<p> | ||
<div layout="row" flex> | ||
\{{#paper-button onClick=(action "flatButton")}}Button with action\{{/paper-button}} | ||
\{{#paper-button noink=true primary=true}}Primary (noink)\{{/paper-button}} | ||
\{{#paper-button disabled=true}}disabled\{{/paper-button}} | ||
\{{#paper-button warn=true}}warn\{{/paper-button}} | ||
</p> | ||
\{{#paper-button href="http://emberjs.com/images/tomsters/original.png" target="_blank"}}href link\{{/paper-button}} | ||
</div> | ||
<p> | ||
\{{#paper-button raised=true onClick=(action "raisedButton")}}Button with action\{{/paper-button}} | ||
\{{#paper-button raised=true primary=true}}Primary\{{/paper-button}} | ||
|
@@ -63,4 +65,94 @@ | |
\{{paper-button raised=true label="Blockless version"}} | ||
</p>{{/code-block}} | ||
</div> | ||
|
||
<h2>Usage</h2> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>API</th> | ||
<th>Type</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><strong>accent</strong></td> | ||
<td>boolean</td> | ||
<td>Display in the theme's accent color</td> | ||
</tr> | ||
<tr> | ||
<td><strong>bubbles</strong></td> | ||
<td>boolean</td> | ||
<td>Determines whether the Ember click event handler bubbles. Default is {{#code-inline}}undefined{{/code-inline}}, which bubbles</td> | ||
</tr> | ||
<tr> | ||
<td><strong>disabled</strong></td> | ||
<td>boolean</td> | ||
<td>Whether the button is displayed as disabled and does not accept clicks</td> | ||
</tr> | ||
<tr> | ||
<td><strong>fab</strong></td> | ||
<td>boolean</td> | ||
<td>Display as a Floating Action Button</td> | ||
</tr> | ||
<tr> | ||
<td><strong>href</strong></td> | ||
<td>string</td> | ||
<td>Displays the button as an {{#code-inline}}<a>{{/code-inline}} link to the specified destination URL</td> | ||
</tr> | ||
<tr> | ||
<td><strong>iconButton</strong></td> | ||
<td>boolean</td> | ||
<td>Set when the contents contains an icon and adjusts CSS appropriately</td> | ||
</tr> | ||
<tr> | ||
<td><strong>label</strong></td> | ||
<td>string</td> | ||
<td>Set the content of the button when used as a blockless component</td> | ||
</tr> | ||
<tr> | ||
<td><strong>mini</strong></td> | ||
<td>boolean</td> | ||
<td>Display as a mini-sized button. Implies {{#code-inline}}fab{{/code-inline}}, unless {{#code-inline}}fab{{/code-inline}} is explicity set falsy.</td> | ||
</tr> | ||
<tr> | ||
<td><strong>noInk</strong></td> | ||
<td>boolean</td> | ||
<td>Suppresses the ripple effect when clicked</td> | ||
</tr> | ||
<tr> | ||
<td><strong>onClick</strong></td> | ||
<td>closure</td> | ||
<td>Action sent when the button is clicked</td> | ||
</tr> | ||
<tr> | ||
<td><strong>primary</strong></td> | ||
<td>boolean</td> | ||
<td>Display as the primary button, more prominent that other buttons</td> | ||
</tr> | ||
<tr> | ||
<td><strong>raised</strong></td> | ||
<td>boolean</td> | ||
<td>Display button with a 3-D effect</td> | ||
</tr> | ||
<tr> | ||
<td><strong>target</strong></td> | ||
<td>string</td> | ||
<td>Sets the {{#code-inline}}<a>{{/code-inline}} link target attribute, such as {{#code-inline}}"_blank"{{/code-inline}}</td> | ||
</tr> | ||
<tr> | ||
<td><strong>type</strong></td> | ||
<td>string</td> | ||
<td>Sets the html5 {{#code-inline}}type{{/code-inline}} attribute.</td> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe worth mentioning that it defaults to button. |
||
</tr> | ||
<tr> | ||
<td><strong>warn</strong></td> | ||
<td>boolean</td> | ||
<td>Display in the theme's warn color</td> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. accent, primary and warn are part of a mixin and are present in many other components. We may need to find a better way to show common attributes to avoid repeating ourselves over and over, but for now listing them here seems the best thing to do. |
||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
{{/paper-content}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this uses the layout attribute and a flex class. There is a
layout-row
I think. I've used it in the toolbar page.