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

Unified Diff: remoting/webapp/host_list.js

Issue 10703034: Remove 'Enable' button on unsupported platforms. Added 'No hosts' message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated after UX input. Created 8 years, 6 months 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 | « remoting/webapp/host_controller.js ('k') | remoting/webapp/l10n.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_list.js
diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js
index 399c3f19d7deb415c87fed55b2a2e51d5dfac6b5..c3d2d23d14cd3dfd3bc1e54da3f2f7acfa00016f 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) {
/**
* @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;
/**
@@ -185,7 +193,9 @@ remoting.HostList.prototype.display = function(thisHostId) {
this.errorMsg_.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} */
« no previous file with comments | « remoting/webapp/host_controller.js ('k') | remoting/webapp/l10n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698