mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 09:05:14 -07:00
fix(docs): regenerate playground GIF with held output during typing
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 35 KiB |
Vendored
+4
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
const editors = [editor, dataEditor];
|
const editors = [editor, dataEditor];
|
||||||
let previewValue = '';
|
let previewValue = '';
|
||||||
|
let hadPreview = false;
|
||||||
colorScheme.addEventListener('change', function() {
|
colorScheme.addEventListener('change', function() {
|
||||||
editors.forEach(applyEditorTheme);
|
editors.forEach(applyEditorTheme);
|
||||||
if (previewValue) setPreview(previewValue);
|
if (previewValue) setPreview(previewValue);
|
||||||
@@ -176,7 +177,10 @@
|
|||||||
history.replaceState({}, '', '#' + serializeArgs({tpl, data}));
|
history.replaceState({}, '', '#' + serializeArgs({tpl, data}));
|
||||||
try {
|
try {
|
||||||
const html = await engine.parseAndRender(tpl, JSON.parse(data));
|
const html = await engine.parseAndRender(tpl, JSON.parse(data));
|
||||||
|
if (html !== '' || !hadPreview) {
|
||||||
setPreview(html);
|
setPreview(html);
|
||||||
|
if (html !== '') hadPreview = true;
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// keep last successful output while template or context is invalid
|
// keep last successful output while template or context is invalid
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user