Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit a784984

Browse files
committed
fixed rebasing
1 parent 7fa6868 commit a784984

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@ typings/
5959

6060
# next.js build output
6161
.next
62+
63+
# swap files
64+
*.swo
65+
*.swp

index.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</head>
99
<body style="box-sizing: border-box; margin: 0 auto; max-width: 900px; padding: 50px; width: 100%;">
1010
<div>
11-
<json-schema-validator jsoneditor="./node_modules/jsoneditor" metaschema="./json-schema-draft-04.json" schema="./example-schema.json"></json-schema-validator>
11+
<json-schema-validator jsoneditor="https://unpkg.com/jsoneditor@5.25.0" metaschema="./json-schema-draft-04.json" schema="./example-schema.json"></json-schema-validator>
1212
</div>
1313
<script>
1414

@@ -28,11 +28,18 @@
2828
xhr.send('');
2929
}
3030

31-
setTimeout(function(){
32-
getText("./example-data.json", function(text) {
33-
document.querySelector("json-schema-validator").editor.setText(text);
34-
})
35-
}, 1000);
31+
getText("./example-data.json", function(text) {
32+
var intervalID = setInterval(function(){
33+
var validator = document.querySelector("json-schema-validator");
34+
if (validator.editor) {
35+
console.log("validator.editor exists");
36+
validator.editor.setText(text);
37+
console.log("set text");
38+
clearInterval(intervalID);
39+
console.log("cleared interval");
40+
}
41+
}, 1000);
42+
});
3643
</script>
3744
</body>
38-
</html>
45+
</html>

0 commit comments

Comments
 (0)