Index: remoting/webapp/host_controller.js |
diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js |
index 2b41096845b2d3c9ff99acc73ba7580b6f33a12c..e1395755890cbcbee0a8845f6109d26fad68064e 100644 |
--- a/remoting/webapp/host_controller.js |
+++ b/remoting/webapp/host_controller.js |
@@ -279,13 +279,21 @@ remoting.HostController.prototype.setHost = function(host) { |
remoting.hostList.renameHost(host); |
that.setTooltips(); |
}; |
- /** @type {remoting.HostTableEntry} @private */ |
- this.hostTableEntry_ = new remoting.HostTableEntry(); |
- this.hostTableEntry_.init(host, |
- document.getElementById('this-host-connect'), |
- document.getElementById('this-host-name'), |
- document.getElementById('this-host-rename'), |
- renameHost); |
+ if (!this.hostTableEntry_) { |
+ /** @type {remoting.HostTableEntry} @private */ |
+ this.hostTableEntry_ = new remoting.HostTableEntry(); |
+ this.hostTableEntry_.init(host, |
+ document.getElementById('this-host-connect'), |
+ document.getElementById('this-host-name'), |
+ document.getElementById('this-host-rename'), |
+ renameHost); |
+ } else { |
+ // TODO(jamiewalch): This is hack to prevent multiple click handlers being |
+ // registered for the same DOM elements if this method is called more than |
+ // once. A better solution would be to let HostTable create the daemon row |
+ // like it creates the rows for non-local hosts. |
+ this.hostTableEntry_.host = host; |
+ } |
} else { |
this.hostTableEntry_ = null; |
} |