working nodes sub-texts

This commit is contained in:
Klemek
2019-07-16 18:48:19 +02:00
parent 64d952f8bc
commit 244dc7af6b
5 changed files with 18 additions and 20 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -5
View File
@@ -48,11 +48,11 @@
</div>
<div id="right"></div>
<script>
$.getJSON('sample.json',(data) => {
$('#input').val(JSON.stringify(data, null, 4)).trigger('paste');
});
$(document).ready(() => {
$.getJSON('sample.json', (data) => {
$('#input').val(JSON.stringify(data, null, 4)).trigger('paste');
});
let timeout;
$('#input').on('change keyup paste', () => {
clearTimeout(timeout);
@@ -61,7 +61,7 @@
let data = JSON.parse($('#input').val());
$('#right').html(faDiagrams.compute(data));
}catch(err){
$('#right').html(`<h2>${err.replaceAll('\n','<br>')}</h2>`);
$('#right').html(`<h2>${err.toString().replace(/\n/gm, '<br>')}</h2>`);
}
}, 500);