summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-07 15:15:36 +0200
committerAlon Levy <alon@pobox.com>2015-03-07 15:15:36 +0200
commitfe9c0b3d54b4b2802dab8aa41bcb105d485335f7 (patch)
tree3067ab538faf0d80ef8d92b0b064994af4744cdf
parent5cb415e933313ce4d54ce6a3da9375b1a1bce34a (diff)
client/view/node_info: fix committing of new fields
-rw-r--r--src/client/view/node_info.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/view/node_info.js b/src/client/view/node_info.js
index 7be52907..d2b23e72 100644
--- a/src/client/view/node_info.js
+++ b/src/client/view/node_info.js
@@ -14,7 +14,7 @@ var d = null,
var element = edit_element_for_attribute(attr);
if (element.length == 0) {
- form_add_element(attr, 'textarea');
+ element = form_add_element(attr, 'textarea');
}
return [attr, element];
})),
@@ -22,7 +22,9 @@ var d = null,
status_display = info.find('#displaystatus'),
status = info.find('#editstatus');
-
+/**
+ * Adds the div with the label, return the edit child
+ */
function form_add_element(attr, value_element_type)
{
var div = $('<div></div>'),
@@ -38,6 +40,7 @@ function form_add_element(attr, value_element_type)
div.append(label);
div.append(value);
div.insertBefore(delete_button);
+ return value;
}
function clean_url(candidate_url)