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 /** | 5 /** |
6 * Javascript for DeviceTable UI, served from chrome://bluetooth-internals/. | 6 * Javascript for DeviceTable UI, served from chrome://bluetooth-internals/. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('device_table', function() { | 9 cr.define('device_table', function() { |
10 var COLUMNS = { | 10 var COLUMNS = { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 row.insertCell(); | 114 row.insertCell(); |
115 } | 115 } |
116 | 116 |
117 // Make two extra cells for the inspect button and connect errors. | 117 // Make two extra cells for the inspect button and connect errors. |
118 var inspectCell = row.insertCell(); | 118 var inspectCell = row.insertCell(); |
119 | 119 |
120 // TODO(crbug.com/663830): Replace connection error column with better | 120 // TODO(crbug.com/663830): Replace connection error column with better |
121 // notification system. | 121 // notification system. |
122 var connectErrorCell = row.insertCell(); | 122 var connectErrorCell = row.insertCell(); |
123 | 123 |
124 var inspectButton = document.createElement('button'); | 124 var inspectButton = document.createElement('a', 'action-link'); |
Dan Beam
2016/12/07 21:57:49
nit: Button -> Link?
| |
125 inspectCell.appendChild(inspectButton); | 125 inspectCell.appendChild(inspectButton); |
126 inspectButton.addEventListener('click', function() { | 126 inspectButton.addEventListener('click', function() { |
127 this.handleInspectBtn_(row.sectionRowIndex); | 127 this.handleInspectBtn_(row.sectionRowIndex); |
128 }.bind(this)); | 128 }.bind(this)); |
129 | 129 |
130 this.updateRow_(device, row.sectionRowIndex); | 130 this.updateRow_(device, row.sectionRowIndex); |
131 }, | 131 }, |
132 | 132 |
133 /** | 133 /** |
134 * Deletes and recreates the table using the cached |devices_|. | 134 * Deletes and recreates the table using the cached |devices_|. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 cell.textContent = obj == null ? 'Unknown' : obj; | 198 cell.textContent = obj == null ? 'Unknown' : obj; |
199 cell.dataset.label = header.textContent; | 199 cell.dataset.label = header.textContent; |
200 } | 200 } |
201 }, | 201 }, |
202 }; | 202 }; |
203 | 203 |
204 return { | 204 return { |
205 DeviceTable: DeviceTable, | 205 DeviceTable: DeviceTable, |
206 }; | 206 }; |
207 }); | 207 }); |
OLD | NEW |