diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-07 00:27:30 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-07 00:27:30 +0200 |
| commit | e49f1de3b8f68caf8944cda3d4b54c67da2006e0 (patch) | |
| tree | b3e7648e074a4339d728c07f48c33a98a4174b56 /src/rz_core.js | |
| parent | 7c58983a909b3bf76667339d60cb0e31555218a6 (diff) | |
node_info cleanup
show correct fields per node type
don't accumulate callbacks (was unusable)
update dialog on save with type change - no need to click node again
Diffstat (limited to 'src/rz_core.js')
| -rw-r--r-- | src/rz_core.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/rz_core.js b/src/rz_core.js index d8c549a6..ad6755b3 100644 --- a/src/rz_core.js +++ b/src/rz_core.js @@ -708,14 +708,19 @@ function tick(e) { function showNodeInfo(d, i) { view.node_info.show(d); - view.node_info.on_submit(function() { - if (d.type === "deliverable") { - graph.editDates(d.id, null, new Date($("#editstartdate").val()), new Date($("#editenddate").val())); + view.node_info.on_submit(function(e, form) { + var old_type = d.type, + new_type = form.type; + if (d.type === "third-internship-proposal") { + graph.editDates(d.id, null, new Date(form.startdate), new Date(form.enddate)); + } + graph.editName(d.id, form.name); + graph.editType(d.id, d.type, form.type); + graph.editURL(d.id, d.type, form.url); + graph.editStatus(d.id, d.type, form.status); + if (new_type != old_type) { + view.node_info.show(d); } - graph.editName(d.id, $('.info').find('#editformname').val()); - graph.editType(d.id, d.type,$('#edittype').val()); - graph.editURL(d.id, d.type, $('#editurl').val()); - graph.editStatus(d.id, d.type, $('#editstatus').val()); update_view__graph(true); return false; }); |
