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 behaviors: [Polymer.IronA11yKeysBehavior], | 8 behaviors: [Polymer.IronA11yKeysBehavior], |
9 | 9 |
10 properties: { | 10 properties: { |
11 selectedPage: {type: String, notify: true}, | 11 selectedPage: {type: String, notify: true}, |
12 | 12 |
13 route: Object, | |
14 | |
15 showFooter: Boolean, | 13 showFooter: Boolean, |
16 | 14 |
17 // If true, the sidebar is contained within an app-drawer. | 15 // If true, the sidebar is contained within an app-drawer. |
18 drawer: {type: Boolean, reflectToAttribute: true}, | 16 drawer: {type: Boolean, reflectToAttribute: true}, |
19 }, | 17 }, |
20 | 18 |
21 keyBindings: { | 19 keyBindings: { |
22 'space:keydown': 'onSpacePressed_', | 20 'space:keydown': 'onSpacePressed_', |
23 }, | 21 }, |
24 | 22 |
(...skipping 17 matching lines...) Expand all Loading... |
42 */ | 40 */ |
43 onClearBrowsingDataTap_: function(e) { | 41 onClearBrowsingDataTap_: function(e) { |
44 var browserService = md_history.BrowserService.getInstance(); | 42 var browserService = md_history.BrowserService.getInstance(); |
45 browserService.recordAction('InitClearBrowsingData'); | 43 browserService.recordAction('InitClearBrowsingData'); |
46 browserService.openClearBrowsingData(); | 44 browserService.openClearBrowsingData(); |
47 /** @type {PaperRippleElement} */(this.$['cbd-ripple']).upAction(); | 45 /** @type {PaperRippleElement} */(this.$['cbd-ripple']).upAction(); |
48 e.preventDefault(); | 46 e.preventDefault(); |
49 }, | 47 }, |
50 | 48 |
51 /** | 49 /** |
52 * @param {Object} route | 50 * Prevent clicks on sidebar items from navigating. These are only links for |
| 51 * accessibility purposes, taps are handled separately by <iron-selector>. |
53 * @private | 52 * @private |
54 */ | 53 */ |
55 getQueryString_: function(route) { return window.location.search; } | 54 onItemClick_: function(e) { |
| 55 e.preventDefault(); |
| 56 }, |
56 }); | 57 }); |
OLD | NEW |