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

Unified Diff: polymer_0.5.0/bower_components/paper-button/paper-button-base.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 12 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.0/bower_components/paper-button/paper-button-base.html
diff --git a/bower_components/paper-button/paper-button-base.html b/polymer_0.5.0/bower_components/paper-button/paper-button-base.html
similarity index 64%
rename from bower_components/paper-button/paper-button-base.html
rename to polymer_0.5.0/bower_components/paper-button/paper-button-base.html
index cfbad280c016952f948f53566a9d261ee2725640..8f62aa72e448b9b784067bc783bd7d73246c29ba 100644
--- a/bower_components/paper-button/paper-button-base.html
+++ b/polymer_0.5.0/bower_components/paper-button/paper-button-base.html
@@ -13,46 +13,50 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
`paper-button-base` is the base class for button-like elements with ripple and optional shadow.
@element paper-button-base
-@extends paper-focusable
+@mixins Polymer.CoreFocusable
@status unstable
-->
<link href="../polymer/polymer.html" rel="import">
-<link href="../paper-focusable/paper-focusable.html" rel="import">
+<link href="../core-focusable/core-focusable.html" rel="import">
+<link href="../paper-ripple/paper-ripple.html" rel="import">
-<polymer-element name="paper-button-base" extends="paper-focusable">
+<polymer-element name="paper-button-base" tabindex="0">
- <script>
- Polymer({
+<script>
- z: 1,
+ (function() {
+
+ var p = {
+
+ eventDelegates: {
+ down: 'downAction'
+ },
activeChanged: function() {
this.super();
- if (this.active) {
- // FIXME: remove when paper-ripple can have a default 'down' state.
- if (!this.lastEvent) {
- var rect = this.getBoundingClientRect();
- this.lastEvent = {
- x: rect.left + rect.width / 2,
- y: rect.top + rect.height / 2
+ if (this.$.ripple) {
+ if (this.active) {
+ // FIXME: remove when paper-ripple can have a default 'down' state.
+ if (!this.lastEvent) {
+ var rect = this.getBoundingClientRect();
+ this.lastEvent = {
+ x: rect.left + rect.width / 2,
+ y: rect.top + rect.height / 2
+ }
}
+ this.$.ripple.downAction(this.lastEvent);
+ } else {
+ this.$.ripple.upAction();
}
- this.$.ripple.downAction(this.lastEvent);
- } else {
- this.$.ripple.upAction();
}
+
this.adjustZ();
},
disabledChanged: function() {
- this.super();
- if (this.disabled) {
- this.setAttribute('aria-disabled', '');
- } else {
- this.removeAttribute('aria-disabled');
- }
+ this._disabledChanged();
this.adjustZ();
},
@@ -69,17 +73,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
adjustZ: function() {
+ if (!this.$.shadow) {
+ return;
+ }
if (this.active) {
- this.z = 2;
+ this.$.shadow.setZ(2);
} else if (this.disabled) {
- this.z = 0;
+ this.$.shadow.setZ(0);
} else {
- this.z = 1;
+ this.$.shadow.setZ(1);
}
},
downAction: function(e) {
- this.super(e);
+ this._downAction();
+
+ if (this.hasAttribute('noink')) {
+ return;
+ }
+
this.lastEvent = e;
if (!this.$.ripple) {
var ripple = document.createElement('paper-ripple');
@@ -98,6 +110,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
}
- });
- </script>
+ };
+
+ Polymer.mixin2(p, Polymer.CoreFocusable);
+ Polymer(p);
+
+ })();
+
+</script>
</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698