Skip to content

Commit a16c2e9

Browse files
committed
web: Make idiomorph optional. Fixes /setup
1 parent 7bc4235 commit a16c2e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

builtin-programs/web/web.folk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ fn HtmlWhen args {
144144
const el = document.currentScript.previousElementSibling;
145145
const callbacks = {$callbacksJs};
146146
folk.subscribe(`the html for {$pattern} is /html/`, ({html}) => {
147-
Idiomorph.morph(el, html, {morphStyle:'innerHTML', callbacks:callbacks});
147+
if (window.Idiomorph) {
148+
Idiomorph.morph(el, html, {morphStyle:'innerHTML', callbacks:callbacks});
149+
} else {
150+
el.innerHTML = html;
151+
}
148152
});
149153
})();
150154
</script>

0 commit comments

Comments
 (0)