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

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

Issue 2341593002: [MD settings] ripple on mouse down in side nav (Closed)
Patch Set: Created 4 years, 3 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 | « chrome/browser/resources/settings/settings_menu/settings_menu.html ('k') | no next file » | 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 this.$.advancedMenu.selected = null; 63 this.$.advancedMenu.selected = null;
64 // For routes from URL entry, we need to set selected. 64 // For routes from URL entry, we need to set selected.
65 this.$.basicMenu.selected = newRoute.path; 65 this.$.basicMenu.selected = newRoute.path;
66 } 66 }
67 }, 67 },
68 68
69 /** 69 /**
70 * @param {!Event} event 70 * @param {!Event} event
71 * @private 71 * @private
72 */ 72 */
73 ripple_: function(event) {
74 var ripple = document.createElement('paper-ripple');
75 ripple.addEventListener('transitionend', function() {
76 ripple.remove();
77 });
78 event.currentTarget.appendChild(ripple);
79 ripple.downAction();
80 ripple.upAction();
81 },
82
83 /**
84 * @param {!Event} event
85 * @private
86 */
87 openPage_: function(event) { 73 openPage_: function(event) {
88 var route = settings.getRouteForPath(event.currentTarget.dataset.path); 74 var route = settings.getRouteForPath(event.currentTarget.dataset.path);
89 assert(route, 'settings-menu has an an entry with an invalid path'); 75 assert(route, 'settings-menu has an an entry with an invalid path');
90 settings.navigateTo(route); 76 settings.navigateTo(route);
91 }, 77 },
92 78
93 /** 79 /**
94 * @param {boolean} opened Whether the menu is expanded. 80 * @param {boolean} opened Whether the menu is expanded.
95 * @return {string} Which icon to use. 81 * @return {string} Which icon to use.
96 * @private 82 * @private
97 * */ 83 * */
98 arrowState_: function(opened) { 84 arrowState_: function(opened) {
99 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; 85 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down';
100 }, 86 },
101 }); 87 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_menu/settings_menu.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698