Commit 38b8247e authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

catch exceptions in loadData().

parent 53b6fdaa
......@@ -236,6 +236,11 @@
});
var loadData = function (data) {
dream_instance.clearAll();
$('#graph_zone').hide();
$('#spreadsheet_output').hide();
try {
// spreadsheet
var spreadsheet_data = data.spreadsheet;
if (spreadsheet_data !== undefined) {
......@@ -277,6 +282,9 @@
} else {
dream_instance.redraw();
}
} catch (e) {
alert('Loading data failed.');
}
};
// Check if there is already data when we first load the page, if yes, then build graph from it
jio.get({
......@@ -461,7 +469,6 @@
$("#import_file").change(function () {
var form = $(this).parent('form')[0];
var form_data = new FormData(form);
dream_instance.clearAll();
$.ajax('/postJSONFile', {
type: 'POST',
contentType: false,
......
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