OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * `settings-toggle-button` is a toggle that controls a supplied preference. | 7 * `settings-toggle-button` is a toggle that controls a supplied preference. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-toggle-button', | 10 is: 'settings-toggle-button', |
11 | 11 |
12 properties: { | 12 properties: { |
13 elideLabel: { | 13 elideLabel: { |
14 type: Boolean, | 14 type: Boolean, |
15 reflectToAttribute: true, | 15 reflectToAttribute: true, |
16 }, | 16 }, |
17 }, | 17 }, |
18 | 18 |
19 behaviors: [SettingsBooleanControlBehavior], | 19 behaviors: [SettingsBooleanControlBehavior], |
20 | 20 |
21 /** @private */ | 21 /** @private */ |
22 onLabelWrapperTap_: function() { | 22 onLabelWrapperTap_: function() { |
23 if (this.controlDisabled_()) | 23 if (this.controlDisabled_()) |
24 return; | 24 return; |
25 | 25 |
26 this.checked = !this.checked; | 26 this.checked = !this.checked; |
27 this.notifyChangedByUserInteraction(); | 27 this.notifyChangedByUserInteraction(); |
28 }, | 28 }, |
| 29 |
| 30 /** |
| 31 * TODO(scottchen): temporary fix until polymer gesture bug resolved. See: |
| 32 * https://github.com/PolymerElements/paper-slider/issues/186 |
| 33 * @private |
| 34 */ |
| 35 resetTrackLock_: function() { |
| 36 Polymer.Gestures.gestures.tap.reset(); |
| 37 }, |
29 }); | 38 }); |
OLD | NEW |