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