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-settings-ui' implements the UI for the Settings page. |
| 8 * |
| 9 * Example: |
| 10 * |
| 11 * <cr-settings-ui></cr-settings-ui> |
| 12 * |
| 13 * @group Chrome Settings Elements |
| 14 * @element cr-settings-ui |
| 15 */ |
| 16 Polymer('cr-settings-ui', { |
| 17 publish: { |
| 18 /** |
| 19 * Ordered list of settings pages available to the user. |
| 20 * |
| 21 * To avoid unnecessary DOM manipulation, prefer using Array.prototype |
| 22 * functions on this attribute rather than replacing it with a new array |
| 23 * after setting the attribute initially. |
| 24 * |
| 25 * @attribute pages |
| 26 * @type Array<!Object> |
| 27 * @default [] |
| 28 */ |
| 29 pages: [], |
| 30 |
| 31 /** |
| 32 * Index of the currently shown page in the menu. |
| 33 * |
| 34 * @attribute currentPageIndex |
| 35 * @type number |
| 36 * @default 0 |
| 37 */ |
| 38 currentPageIndex: 0, |
| 39 }, |
| 40 |
| 41 /** |
| 42 * Updates the UI when a page is selected in the nav menu. |
| 43 * |
| 44 * @param {!Event} e The cr-settings-page-select event. |
| 45 * @param {!Object} detail The selected page. |
| 46 * @private |
| 47 */ |
| 48 pageSelected_: function(e, detail) { |
| 49 this.currentPageIndex = this.pages.indexOf(detail); |
| 50 }, |
| 51 }); |
OLD | NEW |