| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 6 Code distributed by Google as part of the polymer project is also | 6 Code distributed by Google as part of the polymer project is also |
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 8 --> | 8 --> |
| 9 | 9 |
| 10 <!-- | 10 <!-- |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 * @default false | 126 * @default false |
| 127 */ | 127 */ |
| 128 disabled: {value: false, reflect: true} | 128 disabled: {value: false, reflect: true} |
| 129 }, | 129 }, |
| 130 | 130 |
| 131 eventDelegates: { | 131 eventDelegates: { |
| 132 tap: 'tap' | 132 tap: 'tap' |
| 133 }, | 133 }, |
| 134 | 134 |
| 135 tap: function() { | 135 tap: function() { |
| 136 if (this.disabled) { |
| 137 return; |
| 138 } |
| 136 var old = this.checked; | 139 var old = this.checked; |
| 137 this.toggle(); | 140 this.toggle(); |
| 138 if (this.checked !== old) { | 141 if (this.checked !== old) { |
| 139 this.fire('change'); | 142 this.fire('change'); |
| 140 } | 143 } |
| 141 }, | 144 }, |
| 142 | 145 |
| 143 toggle: function() { | 146 toggle: function() { |
| 144 this.checked = !this.toggles || !this.checked; | 147 this.checked = !this.toggles || !this.checked; |
| 145 }, | 148 }, |
| 146 | 149 |
| 147 checkedChanged: function() { | 150 checkedChanged: function() { |
| 148 this.$.onRadio.classList.toggle('fill', this.checked); | 151 this.$.onRadio.classList.toggle('fill', this.checked); |
| 149 this.setAttribute('aria-checked', this.checked ? 'true': 'false'); | 152 this.setAttribute('aria-checked', this.checked ? 'true': 'false'); |
| 150 this.fire('core-change'); | 153 this.fire('core-change'); |
| 151 }, | 154 }, |
| 152 | 155 |
| 153 labelChanged: function() { | 156 labelChanged: function() { |
| 154 this.setAttribute('aria-label', this.label); | 157 this.setAttribute('aria-label', this.label); |
| 155 } | 158 } |
| 156 | 159 |
| 157 }); | 160 }); |
| 158 | 161 |
| 159 </script> | 162 </script> |
| 160 </polymer-element> | 163 </polymer-element> |
| OLD | NEW |