OLD | NEW |
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 Loading... |
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 }); |
OLD | NEW |