Skip to content

Commit 8671add

Browse files
committed
Fix incorrectly placed setEditorValues.
This was causing framed and compacted side editors to be unusable.
1 parent dde80ce commit 8671add

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

playground/next/editor.bundle.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27423,8 +27423,10 @@
2742327423
if (file === 'library.jsonld') {
2742427424
const frame = await fetch(`/examples/playground/library-frame.jsonld`);
2742527425
this.frameDoc = await frame.json();
27426+
setEditorValue(this.frameEditor, this.frameDoc);
2742627427
} else {
2742727428
this.frameDoc = {};
27429+
setEditorValue(this.frameEditor, this.frameDoc);
2742827430
}
2742927431
this.setOutputTab(this.outputTab);
2743027432
},
@@ -27450,7 +27452,6 @@
2745027452
};
2745127453
this.contextDoc = context;
2745227454
}
27453-
setEditorValue(this.contextEditor, this.contextDoc);
2745427455
try {
2745527456
const compacted = await jsonld.compact(this.doc, {'@context': context['@context'] || {}}, this.options);
2745627457
setEditorValue(readOnlyEditor, compacted);
@@ -27476,10 +27477,8 @@
2747627477
}
2747727478
break;
2747827479
case 'framed':
27479-
const frameDoc = this.frameDoc;
27480-
setEditorValue(this.frameEditor, frameDoc);
2748127480
try {
27482-
const framed = await jsonld.frame(this.doc, frameDoc, this.options);
27481+
const framed = await jsonld.frame(this.doc, this.frameDoc, this.options);
2748327482
setEditorValue(readOnlyEditor, framed);
2748427483
this.parseError = '';
2748527484
} catch(err) {

playground/next/editor.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ window.app = createApp({
206206
if (file === 'library.jsonld') {
207207
const frame = await fetch(`/examples/playground/library-frame.jsonld`);
208208
this.frameDoc = await frame.json();
209+
setEditorValue(this.frameEditor, this.frameDoc);
209210
} else {
210211
this.frameDoc = {};
212+
setEditorValue(this.frameEditor, this.frameDoc);
211213
}
212214
this.setOutputTab(this.outputTab);
213215
},
@@ -233,7 +235,6 @@ window.app = createApp({
233235
};
234236
this.contextDoc = context;
235237
}
236-
setEditorValue(this.contextEditor, this.contextDoc);
237238
try {
238239
const compacted = await jsonld.compact(this.doc, {'@context': context['@context'] || {}}, this.options);
239240
setEditorValue(readOnlyEditor, compacted);
@@ -259,10 +260,8 @@ window.app = createApp({
259260
}
260261
break;
261262
case 'framed':
262-
const frameDoc = this.frameDoc;
263-
setEditorValue(this.frameEditor, frameDoc);
264263
try {
265-
const framed = await jsonld.frame(this.doc, frameDoc, this.options);
264+
const framed = await jsonld.frame(this.doc, this.frameDoc, this.options);
266265
setEditorValue(readOnlyEditor, framed);
267266
this.parseError = '';
268267
} catch(err) {

0 commit comments

Comments
 (0)