diff options
| author | Alon Levy <alon@pobox.com> | 2014-11-11 15:28:20 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-11-11 15:29:32 +0200 |
| commit | 73ef7c098053592db020bc3691180c49e5f45cf6 (patch) | |
| tree | 407a6da5803be833ac03994e3ac57e83b3e8b7b3 | |
| parent | f792e0ddc1976ce7f3e430618f86891c8cf9b3ae (diff) | |
introduce a view wrapper, view/view
| -rw-r--r-- | scripts/rz_core.js | 14 | ||||
| -rw-r--r-- | scripts/view/view.js | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/scripts/rz_core.js b/scripts/rz_core.js index 97dfafa9..307a3594 100644 --- a/scripts/rz_core.js +++ b/scripts/rz_core.js @@ -1,7 +1,7 @@ "use strict" -define(['jquery', 'd3', 'consts', 'signal', 'util', 'model/graph', 'view/helpers', 'view/node_info'], -function($, d3, consts, signal, util, model_graph, view_helpers, view_node_info) { +define(['jquery', 'd3', 'consts', 'signal', 'util', 'model/graph', 'view/helpers', 'view/view'], +function($, d3, consts, signal, util, model_graph, view_helpers, view) { var addednodes = []; @@ -519,8 +519,8 @@ function highlight(n) function showInfo(d, i) { if (d.state !== "chosen" && d.state !== 'temp') { highlight(d); - view_node_info.show(d); - view_node_info.on_submit(function() { + 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())); } @@ -529,16 +529,16 @@ function showInfo(d, i) { graph.update(true); return false; }); - view_node_info.on_delete(function() { + view.node_info.on_delete(function() { if (confirm('This node and all its connections will be deleted, are you sure?')) { graph.removeNode(d.id, null); graph.update(false); - view_node_info.hide(); + view.node_info.hide(); } }); } else { removeHighlight(); - view_node_info.hide(); + view.node_info.hide(); } graph.update(true); } diff --git a/scripts/view/view.js b/scripts/view/view.js new file mode 100644 index 00000000..246e9ddc --- /dev/null +++ b/scripts/view/view.js @@ -0,0 +1,5 @@ +define(['view/node_info'], function(view_node_info) { +return { + 'node_info': view_node_info, +}; +}); |
