Index: remoting/webapp/me2mom/host_table_entry.js |
diff --git a/remoting/webapp/me2mom/host_table_entry.js b/remoting/webapp/me2mom/host_table_entry.js |
index 5b65f3ee5c1ddba125c49f1b0720dec300c6ed0d..1fe060589a13df280017673d4382922d181cc65e 100644 |
--- a/remoting/webapp/me2mom/host_table_entry.js |
+++ b/remoting/webapp/me2mom/host_table_entry.js |
@@ -42,15 +42,17 @@ remoting.HostTableEntry = function() { |
this.tableRow = null; |
/** @type {Element} @private */ |
this.hostNameCell_ = null; |
- /** @type {function():void} @private */ |
- this.onRename_ = function() {}; |
+ /** @type {function(remoting.HostTableEntry):void} @private */ |
+ this.onRename_ = function(hostId) {}; |
Wez
2011/12/09 22:54:41
nit: In future both onRename_ and onDelete_ will n
Jamie
2011/12/09 23:52:24
Maybe, but that's code for another day.
|
}; |
/** |
* Create the HTML elements for this entry. |
* @param {remoting.Host} host The host, as obtained from Apiary. |
- * @param {function():void} onRename Callback for rename operations. |
- * @param {function():void} onDelete Callback for delete operations. |
+ * @param {function(remoting.HostTableEntry):void} onRename Callback for |
+ * rename operations. |
+ * @param {function(remoting.HostTableEntry):void} onDelete Callback for |
+ * delete operations. |
*/ |
remoting.HostTableEntry.prototype.init = function(host, onRename, onDelete) { |
this.host = host; |
@@ -115,7 +117,7 @@ remoting.HostTableEntry.prototype.init = function(host, onRename, onDelete) { |
// Create the host delete cell. |
var removeButton = document.createElement('td'); |
Wez
2011/12/09 22:54:41
nit: removeButton -> deleteButton, or onDelete->on
Jamie
2011/12/09 23:52:24
Done.
|
- removeButton.onclick = onDelete; |
+ removeButton.onclick = function() { onDelete(that); } |
addClass(removeButton, 'clickable'); |
addClass(removeButton, 'host-list-edit'); |
var crossImage = document.createElement('img'); |
@@ -157,7 +159,7 @@ remoting.HostTableEntry.prototype.commitRename_ = function() { |
if (editBox) { |
if (this.host.hostName != editBox.value) { |
this.host.hostName = editBox.value; |
- this.onRename_(); |
+ this.onRename_(this); |
} |
this.removeEditBox_(); |
} |