diff options
| author | Alon Levy <alon@pobox.com> | 2015-01-21 18:24:54 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-01-21 18:25:47 +0200 |
| commit | c36f33816cd1acf3356b231e91d53df5dd471e5b (patch) | |
| tree | 572e896f5a45f52cefb26026001ca9f8e22ad8a0 /src/client/model | |
| parent | 305db31d00648b23c2b4114e371aaccf7a297bc8 (diff) | |
client: make sure we store all properties coming from the server. Fixes #298
Diffstat (limited to 'src/client/model')
| -rw-r--r-- | src/client/model/core.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/client/model/core.js b/src/client/model/core.js index 2fee5629..2eeff72f 100644 --- a/src/client/model/core.js +++ b/src/client/model/core.js @@ -64,30 +64,36 @@ define(['util'], function(util) { // reuse id if present __set_obj_id(ret, node_spec.id); } + delete node_spec.id; util.assert(undefined != node_spec.name, 'create_node_from_spec: name missing'); ret.name = node_spec.name; + delete node_spec.name; // type if (undefined == node_spec.type) { console.debug('create_node_from_spec: undefined type, falling back to \'perm\''); node_spec.type = 'perm'; } + delete node_spec.state; ret.type = node_spec.type; + delete node_spec.type // status ret.status = node_spec.status || 'unknown'; + delete node_spec.status; // visual ret.x = node_spec.x; ret.y = node_spec.y; + delete node_spec.x; + delete node_spec.y; // other - ret.state = node_spec.state; - ret.url = node_spec.url; - ret.start = node_spec.start; - ret.end = node_spec.end; + for (var property in node_spec) { + ret[property] = node_spec[property]; + } return ret; } |
