From f71d0fb73c8b6cef6fd6db4fcd16dced175b7ac5 Mon Sep 17 00:00:00 2001 From: Brian Jemilo II Date: Tue, 2 Jul 2024 23:29:01 -0500 Subject: [PATCH] Fix flash on minimize --- web/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/index.js b/web/index.js index 0556b67..ac0fde0 100644 --- a/web/index.js +++ b/web/index.js @@ -277,7 +277,6 @@ function create_code_widget(code = '# Waiting for code...', language = 'python', button.classList.remove('flash'); codeEl.classList.remove('flash'); setTimeout(() => button.classList.add('flash') || codeEl.classList.add('flash'), 0); - setTimeout(() => button.classList.remove('flash') || codeEl.classList.remove('flash'), 1000); } ); document.body.appendChild(widget.html); @@ -372,6 +371,10 @@ Promise.all([ node.onDrawForeground = function(ctx, graph) { onDrawForeground.apply(this, arguments); widget.html.style.display = this.flags.collapsed ? 'none' : 'block'; + if (this.flags.collapsed) { + widget.html.querySelector('code').classList.remove('flash'); + widget.html.querySelector('.copy-button').classList.remove('flash'); + } }; const onRemoved = node.onRemoved;