OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Polymer({ | 5 Polymer({ |
6 is: 'history-side-bar', | 6 is: 'history-side-bar', |
7 | 7 |
8 properties: { | 8 properties: { |
9 selectedPage: {type: String, notify: true}, | 9 selectedPage: {type: String, notify: true}, |
10 | 10 |
11 route: Object, | 11 route: Object, |
12 | 12 |
13 showFooter: Boolean, | 13 showFooter: Boolean, |
14 | 14 |
15 // If true, the sidebar is contained within an app-drawer. | 15 // If true, the sidebar is contained within an app-drawer. |
16 drawer: {type: Boolean, reflectToAttribute: true}, | 16 drawer: {type: Boolean, reflectToAttribute: true}, |
17 }, | 17 }, |
18 | 18 |
19 listeners: { | |
20 'keydown': 'onKeydown_', | |
21 }, | |
22 | |
19 /** | 23 /** |
20 * @private | 24 * @private |
tsergeant
2016/08/23 05:41:17
Nit: @param annotation
calamity
2016/08/24 03:57:43
Done.
| |
21 */ | 25 */ |
26 onKeydown_: function(e) { | |
27 if (e.code == 'Space') | |
28 e.path[0].click(); | |
29 }, | |
30 | |
31 /** | |
32 * @private | |
33 */ | |
22 onSelectorActivate_: function() { this.fire('history-close-drawer'); }, | 34 onSelectorActivate_: function() { this.fire('history-close-drawer'); }, |
23 | 35 |
24 /** | 36 /** |
25 * Relocates the user to the clear browsing data section of the settings page. | 37 * Relocates the user to the clear browsing data section of the settings page. |
26 * @param {Event} e | 38 * @param {Event} e |
27 * @private | 39 * @private |
28 */ | 40 */ |
29 onClearBrowsingDataTap_: function(e) { | 41 onClearBrowsingDataTap_: function(e) { |
30 var browserService = md_history.BrowserService.getInstance(); | 42 var browserService = md_history.BrowserService.getInstance(); |
31 browserService.recordAction('InitClearBrowsingData'); | 43 browserService.recordAction('InitClearBrowsingData'); |
32 browserService.openClearBrowsingData(); | 44 browserService.openClearBrowsingData(); |
33 e.preventDefault(); | 45 e.preventDefault(); |
34 }, | 46 }, |
35 | 47 |
36 /** | 48 /** |
37 * @param {Object} route | 49 * @param {Object} route |
38 * @private | 50 * @private |
39 */ | 51 */ |
40 getQueryString_: function(route) { return window.location.search; } | 52 getQueryString_: function(route) { return window.location.search; } |
41 }); | 53 }); |
OLD | NEW |