| 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 * 'settings-menu' shows a menu with a hardcoded set of pages and subpages. | 7 * 'settings-menu' shows a menu with a hardcoded set of pages and subpages. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 if (submenu) | 38 if (submenu) |
| 39 submenu.opened = true; | 39 submenu.opened = true; |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 /** @private */ | 42 /** @private */ |
| 43 openPage_: function(event) { | 43 openPage_: function(event) { |
| 44 var submenuRoute = event.currentTarget.dataset.page; | 44 var submenuRoute = event.currentTarget.dataset.page; |
| 45 if (submenuRoute) { | 45 if (submenuRoute) { |
| 46 this.currentRoute = { | 46 this.currentRoute = { |
| 47 page: submenuRoute, | 47 page: submenuRoute, |
| 48 section: '', | 48 section: event.currentTarget.dataset.section, |
| 49 subpage: [], | 49 subpage: [], |
| 50 }; | 50 }; |
| 51 } | 51 } |
| 52 }, | 52 }, |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * @param {boolean} opened Whether the menu is expanded. | 55 * @param {boolean} opened Whether the menu is expanded. |
| 56 * @return {string} Which icon to use. | 56 * @return {string} Which icon to use. |
| 57 * @private | 57 * @private |
| 58 * */ | 58 * */ |
| 59 arrowState_: function(opened) { | 59 arrowState_: function(opened) { |
| 60 return opened ? 'arrow-drop-up' : 'arrow-drop-down'; | 60 return opened ? 'arrow-drop-up' : 'arrow-drop-down'; |
| 61 }, | 61 }, |
| 62 }); | 62 }); |
| OLD | NEW |