Commit a5615f8c by Simon

Fix beug

parent b157647d
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
margin-top: 150px;
} }
.table-responsive { .table-responsive {
......
...@@ -179,7 +179,9 @@ ...@@ -179,7 +179,9 @@
this.getJsonData = () => { this.getJsonData = () => {
let dataJson = this.item.data('json'); let dataJson = this.item.data('json');
if(this.isJsonString(dataJson)){ if(typeof dataJson === 'object') {
this.json = dataJson;
} else if(this.isJsonString(dataJson)){
this.json = JSON.parse(dataJson); this.json = JSON.parse(dataJson);
} else { } else {
let data = this.fileExistsAndGetData(dataJson); let data = this.fileExistsAndGetData(dataJson);
...@@ -227,7 +229,7 @@ ...@@ -227,7 +229,7 @@
* Generate JSON * Generate JSON
*/ */
this.createJSON = () => { this.createJSON = () => {
let $input = $(this.config.output); let $input = $(this.config.inputSelector);
if ($input.length > 0) { if ($input.length > 0) {
$input.val(JSON.stringify(this.outputJson)); $input.val(JSON.stringify(this.outputJson));
...@@ -631,7 +633,9 @@ ...@@ -631,7 +633,9 @@
this.getJsonData = () => { this.getJsonData = () => {
let dataJson = $(this.config.inputSelector).val(); let dataJson = $(this.config.inputSelector).val();
if(this.isJsonString(dataJson)){ if(typeof dataJson === 'object') {
this.json = dataJson;
} else if(this.isJsonString(dataJson)){
this.json = JSON.parse(dataJson); this.json = JSON.parse(dataJson);
} else { } else {
let data = this.fileExistsAndGetData(dataJson); let data = this.fileExistsAndGetData(dataJson);
...@@ -643,10 +647,10 @@ ...@@ -643,10 +647,10 @@
} }
} }
} }
this.populateOutputJson(); this.populateOutputJson();
}; };
this.populateOutputJson = () => { this.populateOutputJson = () => {
for (let index in this.json) { for (let index in this.json) {
if (this.json[index].length === 0 ) { if (this.json[index].length === 0 ) {
......
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