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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js

Issue 1401633002: Update Polymer from 1.1.4 -> 1.1.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dzhioev@ review Created 5 years, 2 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: third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js
index b830c52b3da2da76f262ceb18dbd9afc2d1df9a0..6c022f31d044c97206b1c9b11ff72cc7288358c2 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js
@@ -1,23 +1,34 @@
-
-
- /** @polymerBehavior */
+/** @polymerBehavior Polymer.PaperButtonBehavior */
Polymer.PaperButtonBehaviorImpl = {
properties: {
- _elevation: {
- type: Number
+ /**
+ * The z-depth of this element, from 0-5. Setting to 0 will remove the
+ * shadow, and each increasing number greater than 0 will be "deeper"
+ * than the last.
+ *
+ * @attribute elevation
+ * @type number
+ * @default 1
+ */
+ elevation: {
+ type: Number,
+ reflectToAttribute: true,
+ readOnly: true
}
},
observers: [
- '_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)'
+ '_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)',
+ '_computeKeyboardClass(receivedFocusFromKeyboard)'
],
hostAttributes: {
role: 'button',
- tabindex: '0'
+ tabindex: '0',
+ animated: true
},
_calculateElevation: function() {
@@ -29,14 +40,41 @@
} else if (this.receivedFocusFromKeyboard) {
e = 3;
}
- this._elevation = e;
+ this._setElevation(e);
+ },
+
+ _computeKeyboardClass: function(receivedFocusFromKeyboard) {
+ this.classList.toggle('keyboard-focus', receivedFocusFromKeyboard);
+ },
+
+ /**
+ * In addition to `IronButtonState` behavior, when space key goes down,
+ * create a ripple down effect.
+ */
+ _spaceKeyDownHandler: function(event) {
+ Polymer.IronButtonStateImpl._spaceKeyDownHandler.call(this, event);
+ if (this.hasRipple()) {
+ this._ripple.uiDownAction();
+ }
+ },
+
+ /**
+ * In addition to `IronButtonState` behavior, when space key goes up,
+ * create a ripple up effect.
+ */
+ _spaceKeyUpHandler: function(event) {
+ Polymer.IronButtonStateImpl._spaceKeyUpHandler.call(this, event);
+ if (this.hasRipple()) {
+ this._ripple.uiUpAction();
+ }
}
+
};
/** @polymerBehavior */
Polymer.PaperButtonBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
+ Polymer.PaperRippleBehavior,
Polymer.PaperButtonBehaviorImpl
- ];
-
+ ];

Powered by Google App Engine
This is Rietveld 408576698