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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-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-inky-focus-behavior-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js
index 9130ec1070ff8c9f2e95df15f9935d2f9e4c1084..6d8bc12d357f3c808a5d18ac621ad80bdaee985d 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js
@@ -1,9 +1,7 @@
-
-
- /**
+/**
* `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has keyboard focus.
*
- * @polymerBehavior Polymer.PaperInkyFocusBehavior
+ * @polymerBehavior Polymer.PaperInkyFocusBehaviorImpl
*/
Polymer.PaperInkyFocusBehaviorImpl = {
@@ -12,11 +10,20 @@
],
_focusedChanged: function(receivedFocusFromKeyboard) {
- if (!this.$.ink) {
- return;
+ if (receivedFocusFromKeyboard) {
+ this.ensureRipple();
}
-
- this.$.ink.holdDown = receivedFocusFromKeyboard;
+ if (this.hasRipple()) {
+ this._ripple.holdDown = receivedFocusFromKeyboard;
+ }
+ },
+
+ _createRipple: function() {
+ var ripple = Polymer.PaperRippleBehavior._createRipple();
+ ripple.id = 'ink';
+ ripple.setAttribute('center', '');
+ ripple.classList.add('circle');
+ return ripple;
}
};
@@ -25,6 +32,6 @@
Polymer.PaperInkyFocusBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
+ Polymer.PaperRippleBehavior,
Polymer.PaperInkyFocusBehaviorImpl
- ];
-
+ ];

Powered by Google App Engine
This is Rietveld 408576698