| 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]]" selected-id="{{selectedId}}"> |
| 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({ |
| 18 publish: { | 18 is: 'cr-settings-menu', |
| 19 |
| 20 properties: { |
| 19 /** | 21 /** |
| 20 * Pages to show menu items for. | 22 * Pages to show menu items for. |
| 21 * | 23 * |
| 22 * @attribute pages | 24 * @type {!Array<!Object>} |
| 23 * @type Array<!Object> | |
| 24 * @default null | |
| 25 */ | 25 */ |
| 26 pages: null, | 26 pages: { |
| 27 type: Array, |
| 28 value: function() { return []; }, |
| 29 }, |
| 27 | 30 |
| 28 /** | 31 /** |
| 29 * ID of the currently selected page. | 32 * ID of the currently selected page. |
| 30 * | |
| 31 * @attribute selectedId | |
| 32 * @type string | |
| 33 * default '' | |
| 34 */ | 33 */ |
| 35 selectedId: '', | 34 selectedId: { |
| 36 }, | 35 type: String, |
| 37 | 36 value: '', |
| 38 /** @override */ | 37 notify: true, |
| 39 created: function() { | 38 }, |
| 40 this.pages = []; | |
| 41 }, | 39 }, |
| 42 }); | 40 }); |
| OLD | NEW |