|
13 | 13 |
|
14 | 14 | <script> |
15 | 15 |
|
16 | | - /** |
17 | | - * `Polymer.PaperRippleBehavior` dynamically implements a ripple |
| 16 | + /** |
| 17 | + * `Polymer.PaperRippleBehavior` dynamically implements a ripple |
18 | 18 | * when the element has focus via pointer or keyboard. |
19 | 19 | * |
20 | 20 | * NOTE: This behavior is intended to be used in conjunction with and after |
21 | 21 | * `Polymer.IronButtonState` and `Polymer.IronControlState`. |
22 | 22 | * |
23 | | - * @polymerBehavior Polymer.PaperRippleBehavior |
| 23 | + * @polymerBehavior Polymer.PaperRippleBehavior |
24 | 24 | */ |
25 | 25 | Polymer.PaperRippleBehavior = { |
26 | 26 |
|
|
32 | 32 | noink: { |
33 | 33 | type: Boolean, |
34 | 34 | observer: '_noinkChanged' |
| 35 | + }, |
| 36 | + |
| 37 | + /** |
| 38 | + * @type {Element|undefined} |
| 39 | + */ |
| 40 | + _rippleContainer: { |
| 41 | + type: Object, |
35 | 42 | } |
36 | 43 | }, |
37 | 44 |
|
38 | 45 | /** |
39 | | - * Ensures a `<paper-ripple>` element is available when the element is |
| 46 | + * Ensures a `<paper-ripple>` element is available when the element is |
40 | 47 | * focused. |
41 | 48 | */ |
42 | 49 | _buttonStateChanged: function() { |
|
45 | 52 | } |
46 | 53 | }, |
47 | 54 |
|
48 | | - /** |
| 55 | + /** |
49 | 56 | * In addition to the functionality provided in `IronButtonState`, ensures |
50 | 57 | * a ripple effect is created when the element is in a `pressed` state. |
51 | 58 | */ |
|
57 | 64 | }, |
58 | 65 |
|
59 | 66 | /** |
60 | | - * Ensures this element contains a ripple effect. For startup efficiency |
| 67 | + * Ensures this element contains a ripple effect. For startup efficiency |
61 | 68 | * the ripple effect is dynamically on demand when needed. |
62 | | - * @param {!Event=} opt_triggeringEvent (optional) event that triggered the |
| 69 | + * @param {!Event=} opt_triggeringEvent (optional) event that triggered the |
63 | 70 | * ripple. |
64 | 71 | */ |
65 | 72 | ensureRipple: function(opt_triggeringEvent) { |
|
70 | 77 | if (rippleContainer) { |
71 | 78 | Polymer.dom(rippleContainer).appendChild(this._ripple); |
72 | 79 | } |
73 | | - var domContainer = rippleContainer === this.shadyRoot ? this : |
| 80 | + var domContainer = rippleContainer === this.shadyRoot ? this : |
74 | 81 | rippleContainer; |
75 | 82 | if (opt_triggeringEvent && |
76 | 83 | domContainer.contains(opt_triggeringEvent.target)) { |
|
82 | 89 | /** |
83 | 90 | * Returns the `<paper-ripple>` element used by this element to create |
84 | 91 | * ripple effects. The element's ripple is created on demand, when |
85 | | - * necessary, and calling this method will force the |
| 92 | + * necessary, and calling this method will force the |
86 | 93 | * ripple to be created. |
87 | 94 | */ |
88 | 95 | getRipple: function() { |
|
101 | 108 | /** |
102 | 109 | * Create the element's ripple effect via creating a `<paper-ripple>`. |
103 | 110 | * Override this method to customize the ripple element. |
104 | | - * @return {element} Returns a `<paper-ripple>` element. |
| 111 | + * @return {!PaperRippleElement} Returns a `<paper-ripple>` element. |
105 | 112 | */ |
106 | 113 | _createRipple: function() { |
107 | | - return document.createElement('paper-ripple'); |
| 114 | + return /** @type {!PaperRippleElement} */ ( |
| 115 | + document.createElement('paper-ripple')); |
108 | 116 | }, |
109 | 117 |
|
110 | 118 | _noinkChanged: function(noink) { |
|
0 commit comments