From 1606c32b9ead324c065624223f3897b439c9ba2b Mon Sep 17 00:00:00 2001 From: lqdev Date: Wed, 21 Feb 2024 23:28:13 +0100 Subject: [PATCH] fix placeholders again --- static/js/components/literate-programming.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/components/literate-programming.js b/static/js/components/literate-programming.js index 012bca9..49da606 100644 --- a/static/js/components/literate-programming.js +++ b/static/js/components/literate-programming.js @@ -200,7 +200,10 @@ class OutputMode { } clearConsole() { - this.frame.removeChild(this.frame.placeholderConsole); + if (this.frame.placeholderConsole != null) { + this.frame.removeChild(this.frame.placeholderConsole); + this.frame.placeholderConsole = null; + } this.console.replaceChildren(); } @@ -242,6 +245,7 @@ class OutputMode { // Fade the iframe in after it becomes visible, and remove the image. setTimeout(() => this.iframe.classList.add("loaded"), 0); this.frame.removeChild(this.frame.placeholderImage); + this.frame.placeholderImage = null; } else { // If there is no image, don't do the fade in. this.iframe.classList.add("loaded");