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

Side by Side Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js

Issue 2945433002: MD Settings: fix incorrect behavior with Enter on bluetooth item's icon-button. (Closed)
Patch Set: be explicit about event param Created 3 years, 5 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/bluetooth_page/bluetooth_device_list_item.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 Polymer element for displaying a bluetooth device in a list. 6 * @fileoverview Polymer element for displaying a bluetooth device in a list.
7 */ 7 */
8 8
9 Polymer({ 9 Polymer({
10 is: 'bluetooth-device-list-item', 10 is: 'bluetooth-device-list-item',
11 11
12 behaviors: [I18nBehavior], 12 behaviors: [I18nBehavior],
13 13
14 properties: { 14 properties: {
15 /** 15 /**
16 * The bluetooth device. 16 * The bluetooth device.
17 * @type {!chrome.bluetooth.Device} 17 * @type {!chrome.bluetooth.Device}
18 */ 18 */
19 device: { 19 device: {
20 type: Object, 20 type: Object,
21 }, 21 },
22 }, 22 },
23 23
24 /** 24 /**
25 * @param {!Event} event 25 * @param {!Event} event
26 * @private 26 * @private
27 */
28 ignoreEnterKey_: function(event) {
29 if (event.key == 'Enter') {
30 event.stopPropagation();
31 }
32 },
33
34 /**
35 * @param {!Event} event
36 * @private
27 */ 37 */
28 onMenuButtonTap_: function(event) { 38 onMenuButtonTap_: function(event) {
29 var button = /** @type {!HTMLElement} */ (event.target); 39 var button = /** @type {!HTMLElement} */ (event.target);
30 var menu = /** @type {!CrActionMenuElement} */ (this.$.dotsMenu); 40 var menu = /** @type {!CrActionMenuElement} */ (this.$.dotsMenu);
31 menu.showAt(button); 41 menu.showAt(button);
32 event.stopPropagation(); 42 event.stopPropagation();
33 }, 43 },
34 44
35 /** @private */ 45 /** @private */
36 onConnectActionTap_: function() { 46 onConnectActionTap_: function() {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 case 'tablet': 139 case 'tablet':
130 return 'settings:tablet'; 140 return 'settings:tablet';
131 case 'mouse': 141 case 'mouse':
132 return 'settings:mouse'; 142 return 'settings:mouse';
133 default: 143 default:
134 return device.connected ? 'settings:bluetooth-connected' : 144 return device.connected ? 'settings:bluetooth-connected' :
135 'settings:bluetooth'; 145 'settings:bluetooth';
136 } 146 }
137 }, 147 },
138 }); 148 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698