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

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

Issue 2427743003: MD Settings: fix double-tap to hide advanced bug (Closed)
Patch Set: nit Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/settings_ui_browsertest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 11 matching lines...) Expand all
22 22
23 /** 23 /**
24 * Dictionary defining page visibility. 24 * Dictionary defining page visibility.
25 * @type {!GuestModePageVisibility} 25 * @type {!GuestModePageVisibility}
26 */ 26 */
27 pageVisibility: { 27 pageVisibility: {
28 type: Object, 28 type: Object,
29 }, 29 },
30 }, 30 },
31 31
32 ready: function() {
33 // When a <paper-submenu> is created with the [opened] attribute as true,
34 // its _active member isn't correctly initialized. See this bug for more
35 // info: https://github.com/PolymerElements/paper-menu/issues/88. This means
36 // the first tap to close an opened Advanced section does nothing (because
37 // it calls .open() on an opened menu instead of .close(). This is a fix for
38 // that bug without changing that code through its public API.
39 //
40 // TODO(dbeam): we're currently deciding whether <paper-{,sub}menu> are
41 // right for our needs (there have been minor a11y problems). If we decide
42 // to keep <paper-{,sub}menu>, fix this bug with a local Chrome CL (ex:
43 // https://codereview.chromium.org/2412343004) or a Polymer PR (ex:
44 // https://github.com/PolymerElements/paper-menu/pull/107).
45 if (this.advancedOpened)
46 this.$.advancedPage.open();
47 },
48
32 /** 49 /**
33 * @param {!settings.Route} newRoute 50 * @param {!settings.Route} newRoute
34 */ 51 */
35 currentRouteChanged: function(newRoute) { 52 currentRouteChanged: function(newRoute) {
36 // Make the three menus mutually exclusive. 53 // Make the three menus mutually exclusive.
37 if (settings.Route.ABOUT.contains(newRoute)) { 54 if (settings.Route.ABOUT.contains(newRoute)) {
38 this.aboutSelected_ = true; 55 this.aboutSelected_ = true;
39 this.$.advancedMenu.selected = null; 56 this.$.advancedMenu.selected = null;
40 this.$.basicMenu.selected = null; 57 this.$.basicMenu.selected = null;
41 } else if (settings.Route.ADVANCED.contains(newRoute)) { 58 } else if (settings.Route.ADVANCED.contains(newRoute)) {
(...skipping 21 matching lines...) Expand all
63 80
64 /** 81 /**
65 * @param {boolean} opened Whether the menu is expanded. 82 * @param {boolean} opened Whether the menu is expanded.
66 * @return {string} Which icon to use. 83 * @return {string} Which icon to use.
67 * @private 84 * @private
68 * */ 85 * */
69 arrowState_: function(opened) { 86 arrowState_: function(opened) {
70 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; 87 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down';
71 }, 88 },
72 }); 89 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/settings_ui_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698