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

Unified Diff: chrome/browser/resources/bluetooth_internals/device_table.js

Issue 2558493004: bluetooth: Replace buttons in device table with action links. (Closed)
Patch Set: Change handleInspectBtn_ to handleInspectClick_ Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/bluetooth_internals/bluetooth_internals.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/bluetooth_internals/device_table.js
diff --git a/chrome/browser/resources/bluetooth_internals/device_table.js b/chrome/browser/resources/bluetooth_internals/device_table.js
index e5b598fc123b5404e31ae31d3b049778e22d027d..0fe0291c8ee5bec4ab194b72256b91976a9cd934 100644
--- a/chrome/browser/resources/bluetooth_internals/device_table.js
+++ b/chrome/browser/resources/bluetooth_internals/device_table.js
@@ -13,7 +13,7 @@ cr.define('device_table', function() {
RSSI: 2,
SERVICES: 3,
CONNECTION_STATE: 4,
- INSPECT_BUTTON: 5,
+ INSPECT_LINK: 5,
CONNECTION_ERROR: 6,
};
@@ -75,7 +75,7 @@ cr.define('device_table', function() {
* @private
* @param {number} index
*/
- handleInspectBtn_: function(index) {
+ handleInspectClick_: function(index) {
var event = new CustomEvent('inspectpressed', {
bubbles: true,
detail: {
@@ -114,17 +114,17 @@ cr.define('device_table', function() {
row.insertCell();
}
- // Make two extra cells for the inspect button and connect errors.
+ // Make two extra cells for the inspect link and connect errors.
var inspectCell = row.insertCell();
// TODO(crbug.com/663830): Replace connection error column with better
// notification system.
var connectErrorCell = row.insertCell();
- var inspectButton = document.createElement('button');
- inspectCell.appendChild(inspectButton);
- inspectButton.addEventListener('click', function() {
- this.handleInspectBtn_(row.sectionRowIndex);
+ var inspectLink = document.createElement('a', 'action-link');
+ inspectCell.appendChild(inspectLink);
+ inspectLink.addEventListener('click', function() {
+ this.handleInspectClick_(row.sectionRowIndex);
}.bind(this));
this.updateRow_(device, row.sectionRowIndex);
@@ -157,17 +157,17 @@ cr.define('device_table', function() {
row.classList.toggle('removed', device.removed);
- var inspectButton = row.cells[COLUMNS.INSPECT_BUTTON].children[0];
- inspectButton.disabled = false;
+ var inspectLink = row.cells[COLUMNS.INSPECT_LINK].children[0];
+ inspectLink.disabled = false;
switch (device.connectionStatus) {
case device_collection.ConnectionStatus.DISCONNECTED:
- inspectButton.textContent = 'Inspect';
+ inspectLink.textContent = 'Inspect';
break;
case device_collection.ConnectionStatus.CONNECTED:
- inspectButton.textContent = 'Forget';
+ inspectLink.textContent = 'Forget';
break;
case device_collection.ConnectionStatus.CONNECTING:
- inspectButton.disabled = true;
+ inspectLink.disabled = true;
break;
default: assert('case not handled');
}
« no previous file with comments | « chrome/browser/resources/bluetooth_internals/bluetooth_internals.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698