Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: polymer_0.5.4/bower_components/paper-button/paper-button.html

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_0.5.4/bower_components/paper-button/paper-button.html
diff --git a/polymer_0.5.0/bower_components/paper-button/paper-button.html b/polymer_0.5.4/bower_components/paper-button/paper-button.html
similarity index 86%
copy from polymer_0.5.0/bower_components/paper-button/paper-button.html
copy to polymer_0.5.4/bower_components/paper-button/paper-button.html
index a39814ee433e4a41e77cc304782242caf244d287..e195bc43be155c5ee85f3a4c86b55b68f4ce4ad2 100644
--- a/polymer_0.5.0/bower_components/paper-button/paper-button.html
+++ b/polymer_0.5.4/bower_components/paper-button/paper-button.html
@@ -30,8 +30,7 @@ create a button with an icon and some text:
custom button content
</paper-button>
-Styling
--------
+## Styling
Style the button with CSS as you would a normal DOM element.
@@ -58,6 +57,7 @@ The opacity of the ripple is not customizable via CSS.
<link href="../polymer/polymer.html" rel="import">
<link href="../paper-shadow/paper-shadow.html" rel="import">
+<link href="../core-a11y-keys/core-a11y-keys.html" rel="import">
<link href="paper-button-base.html" rel="import">
@@ -99,7 +99,7 @@ role="button">
text-transform: inherit;
}
- #shadow {
+ #bg, #shadow {
border-radius: inherit;
}
@@ -116,6 +116,7 @@ role="button">
::content > a {
height: 100%;
padding: 0.7em 0.57em;
+ margin: -0.7em -0.57em;
/* flex */
-ms-flex: 1 1 0.000000001px;
-webkit-flex: 1;
@@ -135,6 +136,8 @@ role="button">
<content></content>
</div>
+ <core-a11y-keys keys="space enter" target="{{}}" on-keys-pressed="{{_activate}}"></core-a11y-keys>
+
</template>
<script>
@@ -171,6 +174,22 @@ role="button">
*/
fill: true
+ },
+
+ _activate: function() {
+ this.click();
+ this.fire('tap');
+ if (!this.pressed) {
+ var bcr = this.getBoundingClientRect();
+ var x = bcr.left + (bcr.width / 2);
+ var y = bcr.top + (bcr.height / 2);
+ this.downAction({x: x, y: y});
+ var fn = function fn() {
+ this.upAction();
+ this.removeEventListener('keyup', fn);
+ }.bind(this);
+ this.addEventListener('keyup', fn);
+ }
}
});

Powered by Google App Engine
This is Rietveld 408576698