Commit c83144c9 authored by Jérome Perrin's avatar Jérome Perrin

JS: remove some needless variables

parent bf6d8b4c
...@@ -5,16 +5,14 @@ ...@@ -5,16 +5,14 @@
function saveGraph(evt) { function saveGraph(evt) {
var gadget = this, var gadget = this,
graph_data, graph_data;
graph_gadget;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
// Prevent double click // Prevent double click
evt.target.getElementsByClassName("ui-btn")[0].disabled = true; evt.target.getElementsByClassName("ui-btn")[0].disabled = true;
return gadget.getDeclaredGadget("productionline_graph"); return gadget.getDeclaredGadget("productionline_graph");
}) })
.push(function (graphgadget) { .push(function (graph_gadget) {
graph_gadget = graphgadget;
return graph_gadget.getData(); return graph_gadget.getData();
}) })
.push(function (data) { .push(function (data) {
...@@ -26,10 +24,13 @@ ...@@ -26,10 +24,13 @@
}); });
}) })
.push(function (body) { .push(function (body) {
var data = JSON.parse(body); var data = JSON.parse(body),
data.nodes = JSON.parse(graph_data).nodes; json_graph_data = JSON.parse(graph_data);
data.edges = JSON.parse(graph_data).edges;
data.preference = JSON.parse(graph_data).preference; data.nodes = json_graph_data.nodes;
data.edges = json_graph_data.edges;
data.preference = json_graph_data.preferences;
return gadget.aq_putAttachment({ return gadget.aq_putAttachment({
"_id": gadget.props.jio_key, "_id": gadget.props.jio_key,
"_attachment": "body.json", "_attachment": "body.json",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment