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

Unified Diff: chrome/browser/resources/settings/settings_menu/settings_menu.js

Issue 2708993003: Fix issue where side nav wasn't updated every time the route changed. (Closed)
Patch Set: add tests Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/settings_menu_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/settings_menu/settings_menu.js
diff --git a/chrome/browser/resources/settings/settings_menu/settings_menu.js b/chrome/browser/resources/settings/settings_menu/settings_menu.js
index 306f691c8bf585129c31090e4a80aeb44df67728..122f10a9f681dec320072f202d7c6b19358c557e 100644
--- a/chrome/browser/resources/settings/settings_menu/settings_menu.js
+++ b/chrome/browser/resources/settings/settings_menu/settings_menu.js
@@ -9,6 +9,8 @@
Polymer({
is: 'settings-menu',
+ behaviors: [settings.RouteObserverBehavior],
+
properties: {
advancedOpened: {
type: Boolean,
@@ -29,18 +31,20 @@ Polymer({
'subMenu.tap': 'onLinkTap_',
},
- /** @override */
- attached: function() {
- var currentPath = settings.getCurrentRoute().path;
+ /** @param {!settings.Route} newRoute */
+ currentRouteChanged: function(newRoute) {
+ var currentPath = newRoute.path;
// Focus the initially selected path.
var anchors = this.root.querySelectorAll('a');
for (var i = 0; i < anchors.length; ++i) {
if (anchors[i].getAttribute('href') == currentPath) {
this.setSelectedUrl_(anchors[i].href);
- break;
+ return;
}
}
+
+ this.setSelectedUrl_(''); // Nothing is selected.
},
/**
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/settings_menu_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698