Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: chrome/browser/resources/settings/settings_menu/settings_menu.js

Issue 2184893002: Settings Router Refactor: Remove route.page legacy property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0217-settings-refactor-settings-menu
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 Polymer({ 9 Polymer({
10 is: 'settings-menu', 10 is: 'settings-menu',
(...skipping 22 matching lines...) Expand all
33 }.bind(this)); 33 }.bind(this));
34 34
35 this.$.advancedPage.addEventListener('paper-submenu-open', function() { 35 this.$.advancedPage.addEventListener('paper-submenu-open', function() {
36 this.fire('toggle-advanced-page', true); 36 this.fire('toggle-advanced-page', true);
37 }.bind(this)); 37 }.bind(this));
38 38
39 this.$.advancedPage.addEventListener('paper-submenu-close', function() { 39 this.$.advancedPage.addEventListener('paper-submenu-close', function() {
40 this.fire('toggle-advanced-page', false); 40 this.fire('toggle-advanced-page', false);
41 }.bind(this)); 41 }.bind(this));
42 42
43 this.fire('toggle-advanced-page', this.currentRoute.page == 'advanced'); 43 this.fire('toggle-advanced-page',
44 this.currentRoute.inSubtreeOf(settings.Route.ADVANCED));
44 }, 45 },
45 46
46 /** 47 /**
47 * @param {!settings.Route} newRoute 48 * @param {!settings.Route} newRoute
48 * @private 49 * @private
49 */ 50 */
50 currentRouteChanged_: function(newRoute) { 51 currentRouteChanged_: function(newRoute) {
51 // Sync URL changes to the side nav menu. 52 // Sync URL changes to the side nav menu.
52 this.$.advancedMenu.selected = this.currentRoute.path; 53 this.$.advancedMenu.selected = this.currentRoute.path;
53 this.$.basicMenu.selected = this.currentRoute.path; 54 this.$.basicMenu.selected = this.currentRoute.path;
(...skipping 27 matching lines...) Expand all
81 82
82 /** 83 /**
83 * @param {boolean} opened Whether the menu is expanded. 84 * @param {boolean} opened Whether the menu is expanded.
84 * @return {string} Which icon to use. 85 * @return {string} Which icon to use.
85 * @private 86 * @private
86 * */ 87 * */
87 arrowState_: function(opened) { 88 arrowState_: function(opened) {
88 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; 89 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down';
89 }, 90 },
90 }); 91 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698