| OLD | NEW |
| (Empty) | |
| 1 /** |
| 2 * Use `Polymer.PaperCheckedElementBehavior` to implement a custom element |
| 3 * that has a `checked` property similar to `Polymer.IronCheckedElementBehavio
r` |
| 4 * and is compatible with having a ripple effect. |
| 5 * @polymerBehavior Polymer.PaperCheckedElementBehavior |
| 6 */ |
| 7 Polymer.PaperCheckedElementBehaviorImpl = { |
| 8 |
| 9 /** |
| 10 * Synchronizes the element's checked state with its ripple effect. |
| 11 */ |
| 12 _checkedChanged: function() { |
| 13 Polymer.IronCheckedElementBehaviorImpl._checkedChanged.call(this); |
| 14 if (this.hasRipple()) { |
| 15 if (this.checked) { |
| 16 this._ripple.setAttribute('checked', ''); |
| 17 } else { |
| 18 this._ripple.removeAttribute('checked'); |
| 19 } |
| 20 } |
| 21 }, |
| 22 |
| 23 /** |
| 24 * Synchronizes the element's `active` and `checked` state. |
| 25 */ |
| 26 _buttonStateChanged: function() { |
| 27 Polymer.PaperRippleBehavior._buttonStateChanged.call(this); |
| 28 if (this.disabled) { |
| 29 return; |
| 30 } |
| 31 if (this.isAttached) { |
| 32 this.checked = this.active; |
| 33 } |
| 34 } |
| 35 |
| 36 }; |
| 37 |
| 38 /** @polymerBehavior Polymer.PaperCheckedElementBehavior */ |
| 39 Polymer.PaperCheckedElementBehavior = [ |
| 40 Polymer.PaperInkyFocusBehavior, |
| 41 Polymer.IronCheckedElementBehavior, |
| 42 Polymer.PaperCheckedElementBehaviorImpl |
| 43 ]; |
| OLD | NEW |