| OLD | NEW |
| 1 | 1 /** |
| 2 | |
| 3 /** | |
| 4 * `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has k
eyboard focus. | 2 * `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has k
eyboard focus. |
| 5 * | 3 * |
| 6 * @polymerBehavior Polymer.PaperInkyFocusBehavior | 4 * @polymerBehavior Polymer.PaperInkyFocusBehaviorImpl |
| 7 */ | 5 */ |
| 8 Polymer.PaperInkyFocusBehaviorImpl = { | 6 Polymer.PaperInkyFocusBehaviorImpl = { |
| 9 | 7 |
| 10 observers: [ | 8 observers: [ |
| 11 '_focusedChanged(receivedFocusFromKeyboard)' | 9 '_focusedChanged(receivedFocusFromKeyboard)' |
| 12 ], | 10 ], |
| 13 | 11 |
| 14 _focusedChanged: function(receivedFocusFromKeyboard) { | 12 _focusedChanged: function(receivedFocusFromKeyboard) { |
| 15 if (!this.$.ink) { | 13 if (receivedFocusFromKeyboard) { |
| 16 return; | 14 this.ensureRipple(); |
| 17 } | 15 } |
| 16 if (this.hasRipple()) { |
| 17 this._ripple.holdDown = receivedFocusFromKeyboard; |
| 18 } |
| 19 }, |
| 18 | 20 |
| 19 this.$.ink.holdDown = receivedFocusFromKeyboard; | 21 _createRipple: function() { |
| 22 var ripple = Polymer.PaperRippleBehavior._createRipple(); |
| 23 ripple.id = 'ink'; |
| 24 ripple.setAttribute('center', ''); |
| 25 ripple.classList.add('circle'); |
| 26 return ripple; |
| 20 } | 27 } |
| 21 | 28 |
| 22 }; | 29 }; |
| 23 | 30 |
| 24 /** @polymerBehavior Polymer.PaperInkyFocusBehavior */ | 31 /** @polymerBehavior Polymer.PaperInkyFocusBehavior */ |
| 25 Polymer.PaperInkyFocusBehavior = [ | 32 Polymer.PaperInkyFocusBehavior = [ |
| 26 Polymer.IronButtonState, | 33 Polymer.IronButtonState, |
| 27 Polymer.IronControlState, | 34 Polymer.IronControlState, |
| 35 Polymer.PaperRippleBehavior, |
| 28 Polymer.PaperInkyFocusBehaviorImpl | 36 Polymer.PaperInkyFocusBehaviorImpl |
| 29 ]; | 37 ]; |
| 30 | |
| OLD | NEW |