OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 * 'cr-settings-menu' shows a menu with the given pages. | 7 * 'cr-settings-menu' shows a menu with the given pages. |
8 * | 8 * |
9 * Example: | 9 * Example: |
10 * | 10 * |
11 * <cr-settings-menu pages="{{pages}}" selectedId="{{selectedId}}"> | 11 * <cr-settings-menu pages="{{pages}}" selectedIndex="{{index}}"> |
12 * </cr-settings-menu> | 12 * </cr-settings-menu> |
13 * | 13 * |
14 * @group Chrome Settings Elements | 14 * @group Chrome Settings Elements |
15 * @element cr-settings-menu | 15 * @element cr-settings-menu |
16 */ | 16 */ |
17 Polymer('cr-settings-menu', { | 17 Polymer('cr-settings-menu', { |
18 publish: { | 18 publish: { |
19 /** | 19 /** |
20 * Pages to show menu items for. | 20 * Pages to show menu items for. |
21 * | 21 * |
22 * @attribute pages | 22 * @attribute pages |
23 * @type Array<!Object> | 23 * @type Array<!CrSettingsPage> |
24 * @default null | 24 * @default null |
25 */ | 25 */ |
26 pages: null, | 26 pages: null, |
27 | 27 |
28 /** | 28 /** |
29 * ID of the currently selected page. | 29 * ID of the currently selected page. |
30 * | 30 * |
31 * @attribute selectedId | 31 * @attribute selectedIndex |
32 * @type string | 32 * @type string |
33 * default '' | 33 * default '' |
34 */ | 34 */ |
35 selectedId: '', | 35 selectedId: '', |
| 36 |
| 37 /** |
| 38 * Index of the currently selected page. |
| 39 * |
| 40 * @attribute selectedIndex |
| 41 * @type number |
| 42 * default 0 |
| 43 */ |
| 44 selectedIndex: 0, |
36 }, | 45 }, |
37 | 46 |
38 /** @override */ | 47 /** @override */ |
39 created: function() { | 48 created: function() { |
40 this.pages = []; | 49 this.pages = []; |
41 }, | 50 }, |
42 }); | 51 }); |
OLD | NEW |