diff options
Diffstat (limited to 'remoting/webapp/host_list.js')
| -rw-r--r-- | remoting/webapp/host_list.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js index dd5a546..4a0014d 100644 --- a/remoting/webapp/host_list.js +++ b/remoting/webapp/host_list.js @@ -18,10 +18,11 @@ var remoting = remoting || {}; * if the host-list is empty. * * @constructor - * @param {Element} table The HTML <table> to contain host-list. + * @param {Element} table The HTML <div> to contain host-list. + * @param {Element} noHosts The HTML <div> containing the "no hosts" message. * @param {Element} errorDiv The HTML <div> to display error messages. */ -remoting.HostList = function(table, errorDiv) { +remoting.HostList = function(table, noHosts, errorDiv) { /** * @type {Element} * @private @@ -30,6 +31,13 @@ remoting.HostList = function(table, errorDiv) { /** * @type {Element} * @private + * TODO(jamiewalch): This should be doable using CSS's sibling selector, + * but it doesn't work right now (crbug.com/135050). + */ + this.noHosts_ = noHosts; + /** + * @type {Element} + * @private */ this.errorDiv_ = errorDiv; /** @@ -173,7 +181,9 @@ remoting.HostList.prototype.display = function(thisHostId) { this.errorDiv_.innerText = ''; this.hostTableEntries_ = []; - this.table_.hidden = (this.hosts_.length == 0); + var noHostsRegistered = (this.hosts_.length == 0); + this.table_.hidden = noHostsRegistered; + this.noHosts_.hidden = !noHostsRegistered; for (var i = 0; i < this.hosts_.length; ++i) { /** @type {remoting.Host} */ |
