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

Unified Diff: lib/src/paper-behaviors/paper-inky-focus-behavior.html

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates 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: lib/src/paper-behaviors/paper-inky-focus-behavior.html
diff --git a/lib/src/paper-behaviors/paper-inky-focus-behavior.html b/lib/src/paper-behaviors/paper-inky-focus-behavior.html
index 4f6e9f8933c12202e94cc90e35660c01a7ba8505..76fffc116baf351c2bec4f627c9e547c626e2935 100644
--- a/lib/src/paper-behaviors/paper-inky-focus-behavior.html
+++ b/lib/src/paper-behaviors/paper-inky-focus-behavior.html
@@ -10,6 +10,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html">
+<link rel="import" href="paper-ripple-behavior.html">
<script>
@@ -25,11 +26,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
],
_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;
}
};
@@ -38,6 +48,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
Polymer.PaperInkyFocusBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
+ Polymer.PaperRippleBehavior,
Polymer.PaperInkyFocusBehaviorImpl
];
« no previous file with comments | « lib/src/paper-behaviors/paper-checked-element-behavior.html ('k') | lib/src/paper-behaviors/paper-ripple-behavior.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698