Commit 3e27d0b6 authored by Sebastien Robin's avatar Sebastien Robin

when updating throughput, do not reset everything and prevent enter key to close dialogs

parent 48c8a61c
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
box.throughput = parseInt(throughput.val(), 10); box.throughput = parseInt(throughput.val(), 10);
} }
} }
priv.setModel(); priv.updateModel();
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
}, },
...@@ -135,6 +135,12 @@ ...@@ -135,6 +135,12 @@
}); });
}; };
// Prevent enter key to do nasty things
$('#dialog-form :input').on("keypress", function(e) {
console.log("keyup, e", e);
return e.keyCode !== 13;
});
priv.displayGraph = function () { priv.displayGraph = function () {
var render_element, i, i_length, box, style_string, j, j_length, line; var render_element, i, i_length, box, style_string, j, j_length, line;
// Add boxes in the render div // Add boxes in the render div
...@@ -272,7 +278,7 @@ ...@@ -272,7 +278,7 @@
} }
}; };
priv.updateModel = function (success) { priv.refreshModel = function (success) {
var refreshGraph = function(model) { var refreshGraph = function(model) {
var i, i_length, box, box_list, box, box_id; var i, i_length, box, box_list, box, box_id;
i_length = model.box_list.length; i_length = model.box_list.length;
...@@ -306,12 +312,12 @@ ...@@ -306,12 +312,12 @@
priv.getModel(refreshGraph); priv.getModel(refreshGraph);
}; };
priv.updateModelRegularly = function () { priv.refreshModelRegularly = function () {
var updateRegularly = function() { var refreshRegularly = function() {
priv.updateModel(); priv.refreshModel();
setTimeout(updateRegularly, 1000); setTimeout(refreshRegularly, 1000);
}; };
setTimeout(updateRegularly, 1000); setTimeout(refreshRegularly, 1000);
}; };
Object.defineProperty(that, "start", { Object.defineProperty(that, "start", {
...@@ -323,7 +329,7 @@ ...@@ -323,7 +329,7 @@
priv.initJsPlumb(); priv.initJsPlumb();
priv.initDialog(); priv.initDialog();
priv.displayGraph(); priv.displayGraph();
priv.updateModelRegularly(); priv.refreshModelRegularly();
} }
}); });
......
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