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

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
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 /** 69 /**
70 * @param {!Event} event 70 * @param {!Event} event
71 * @private 71 * @private
72 */ 72 */
73 ripple_: function(event) { 73 ripple_: function(event) {
74 var ripple = document.createElement('paper-ripple'); 74 var ripple = document.createElement('paper-ripple');
75 ripple.addEventListener('transitionend', function() { 75 ripple.addEventListener('transitionend', function() {
76 ripple.remove(); 76 ripple.remove();
77 }); 77 });
78 event.currentTarget.appendChild(ripple); 78 event.currentTarget.appendChild(ripple);
79 ripple.downAction(); 79 ripple.downAction(event);
80 ripple.upAction(); 80 ripple.upAction(event);
81 }, 81 },
82 82
83 /** 83 /**
84 * @param {!Event} event 84 * @param {!Event} event
85 * @private 85 * @private
86 */ 86 */
87 openPage_: function(event) { 87 openPage_: function(event) {
88 var route = settings.getRouteForPath(event.currentTarget.dataset.path); 88 var route = settings.getRouteForPath(event.currentTarget.dataset.path);
89 assert(route, 'settings-menu has an an entry with an invalid path'); 89 assert(route, 'settings-menu has an an entry with an invalid path');
90 settings.navigateTo(route); 90 settings.navigateTo(route);
91 }, 91 },
92 92
93 /** 93 /**
94 * @param {boolean} opened Whether the menu is expanded. 94 * @param {boolean} opened Whether the menu is expanded.
95 * @return {string} Which icon to use. 95 * @return {string} Which icon to use.
96 * @private 96 * @private
97 * */ 97 * */
98 arrowState_: function(opened) { 98 arrowState_: function(opened) {
99 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; 99 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down';
100 }, 100 },
101 }); 101 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698