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

Unified Diff: remoting/webapp/me2mom/host_table_entry.js

Issue 8830001: Pass table entry to rename and delete callbacks, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/me2mom/host_list.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_();
}
« no previous file with comments | « remoting/webapp/me2mom/host_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698