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

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

Issue 2651293003: Make MD Settings side bar keyboard accessible. (Closed)
Patch Set: href the links 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 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // For routes from URL entry, we need to set selected. 66 // For routes from URL entry, we need to set selected.
67 this.$.basicMenu.selected = newRoute.path; 67 this.$.basicMenu.selected = newRoute.path;
68 } 68 }
69 }, 69 },
70 70
71 /** 71 /**
72 * @param {!Event} event 72 * @param {!Event} event
73 * @private 73 * @private
74 */ 74 */
75 openPage_: function(event) { 75 openPage_: function(event) {
76 var route = settings.getRouteForPath(event.currentTarget.dataset.path); 76 event.preventDefault();
77 var path = event.currentTarget.href.substr(
Dan Beam 2017/02/06 17:28:12 btw, there's a URL class new URL(event.currentTar
hcarmona 2017/02/10 19:27:34 Sweet! Using URL.
78 event.currentTarget.baseURI.length - 1);
dschuyler 2017/02/02 20:46:53 My guess is that line 77 is cutting off any query
hcarmona 2017/02/10 19:27:34 Changed to use URL
79 var route = settings.getRouteForPath(path);
77 assert(route, 'settings-menu has an an entry with an invalid path'); 80 assert(route, 'settings-menu has an an entry with an invalid path');
78 settings.navigateTo( 81 settings.navigateTo(
79 route, /* dynamicParams */ null, /* removeSearch */ true); 82 route, /* dynamicParams */ null, /* removeSearch */ true);
80 }, 83 },
81 84
82 /** 85 /**
83 * @param {boolean} opened Whether the menu is expanded. 86 * @param {boolean} opened Whether the menu is expanded.
84 * @return {string} Which icon to use. 87 * @return {string} Which icon to use.
85 * @private 88 * @private
86 * */ 89 * */
87 arrowState_: function(opened) { 90 arrowState_: function(opened) {
88 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; 91 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down';
89 }, 92 },
90 }); 93 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698