diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-03 17:09:48 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-03 17:10:24 +0200 |
| commit | 8388e229a4df0113efade64b7c91c1e08b9f02fa (patch) | |
| tree | f4534ad08d62176486fff50d6d6c4aa841329421 /src/client | |
| parent | 9a09b37ef161ff70b10ef10d5decb2cb9ec321ad (diff) | |
client/node_info: do not update not when diff arrives, fix warnings
needs more complex logic to account for user changes that have not
round-tripped yet, so for now just do not update the dialog.
Fixes #349
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/view/node_info.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/client/view/node_info.js b/src/client/view/node_info.js index 183838b6..d5397db9 100644 --- a/src/client/view/node_info.js +++ b/src/client/view/node_info.js @@ -76,6 +76,15 @@ function disable_change_handlers() change_handlers = []; } +/** + * XXX + * need to update fields if and only if there have been no new input events associated with them since commit. + * do not look at contents because that will exist in the past too. + * + * see Bacon.awaiting. + * + * For now we just show a warning instead telling the user the dialog is not up to date. + */ function setup_click_handlers() { setup_change_handlers(); @@ -104,14 +113,13 @@ function setup_click_handlers() // re-open dialog on node updates while it is open diffBusUnsubscribe = graph.diffBus.onValue(function (diff) { if (model_diff.is_topo_diff(diff) && _.contains(diff.node_id_set_rm, node.id)) { - warning('node has been deleted'); + warning('!! node has been deleted !!'); return; } - if (!model_diff.is_attr_diff(diff) || _.contains(_.keys(model_diff.id_to_node_map), node.id)) { - warning('node has been changed'); + if (model_diff.is_attr_diff(diff) || _.contains(_.keys(diff.id_to_node_map), node.id)) { + warning('!! node has been changed !!'); return; } - show(graph, node); }); } @@ -134,6 +142,7 @@ function show(_graph, d) { flags = visible.hasOwnProperty(d.type) ? visible[d.type] : visible._defaults, i; + warning(''); // reset warning graph = _graph; node = d; util.assert(graph.find_node__by_id(d.id) != null); |
