OLD | NEW |
(Empty) | |
| 1 /* Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. */ |
| 4 |
| 5 /** |
| 6 * @fileoverview |
| 7 * `cr-toggle-button` provides a switch the user can toggle on or off by |
| 8 * tapping or by dragging. Wraps a `paper-toggle-button`. |
| 9 * |
| 10 * Example: |
| 11 * |
| 12 * <cr-toggle-button></cr-toggle-button> |
| 13 * |
| 14 * @element cr-toggle-button |
| 15 */ |
| 16 Polymer({ |
| 17 publish: { |
| 18 /** |
| 19 * Gets or sets the state. `true` is checked and `false` is unchecked. |
| 20 * |
| 21 * @attribute checked |
| 22 * @type boolean |
| 23 * @default false |
| 24 */ |
| 25 checked: { |
| 26 value: false, |
| 27 reflect: true, |
| 28 }, |
| 29 |
| 30 |
| 31 /** |
| 32 * If true, the toggle button is disabled. |
| 33 * |
| 34 * @attribute disabled |
| 35 * @type boolean |
| 36 * @default false |
| 37 */ |
| 38 disabled: { |
| 39 value: false, |
| 40 reflect: true, |
| 41 }, |
| 42 }, |
| 43 |
| 44 ready: function() { |
| 45 this.$.events.forward(this.$.button, ['change']); |
| 46 }, |
| 47 }); |
OLD | NEW |