Chromium Code Reviews| Index: remoting/webapp/host_list.js |
| diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js |
| index 540067efdacd707229ade0c30716d33f0b1c6eb3..9ef8350cf780a6aa7fdcfdc55487853b04d3e2c8 100644 |
| --- a/remoting/webapp/host_list.js |
| +++ b/remoting/webapp/host_list.js |
| @@ -18,12 +18,13 @@ 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} errorMsg The HTML <div> to display error messages. |
| * @param {Element} errorButton The HTML <button> to display the error |
| * resolution action. |
| */ |
| -remoting.HostList = function(table, errorMsg, errorButton) { |
| +remoting.HostList = function(table, noHosts, errorMsg, errorButton) { |
|
Wez
2012/06/28 23:00:20
nit: table, noHost, errorMsg -> hostListDiv, noHos
Jamie
2012/06/28 23:28:57
It's a fair point, but if I'm we're going try to g
|
| /** |
| * @type {Element} |
| * @private |
| @@ -32,6 +33,13 @@ remoting.HostList = function(table, errorMsg, errorButton) { |
| /** |
| * @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.errorMsg_ = errorMsg; |
| /** |
| @@ -181,7 +189,9 @@ remoting.HostList.prototype.display = function(thisHostId) { |
| this.errorMsg_.innerText = ''; |
| this.hostTableEntries_ = []; |
| - this.table_.hidden = (this.hosts_.length == 0); |
| + var noHosts = (this.hosts_.length == 0); |
|
Wez
2012/06/28 23:00:20
nit: noHosts -> noHostsRegistered, otherwise it's
Jamie
2012/06/28 23:28:57
Done.
|
| + this.table_.hidden = noHosts; |
| + this.noHosts_.hidden = !noHosts; |
| for (var i = 0; i < this.hosts_.length; ++i) { |
| /** @type {remoting.Host} */ |