From 3c4ea98fae1b032ad1d1789ba9968e1730fa2178 Mon Sep 17 00:00:00 2001 From: Dougal Date: Fri, 16 Jun 2023 09:29:57 -0400 Subject: [PATCH] Highlighting tweak: add an outline to make the nesting order clearer. --- static/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/index.js b/static/index.js index 090396675..4b6862b09 100644 --- a/static/index.js +++ b/static/index.js @@ -56,6 +56,8 @@ function attachHovertip(node) { function highlightNode(event, node) { event.stopPropagation(); node.style.backgroundColor = "lightblue"; + node.style.outlineColor = "lightblue"; + node.style.outlineStyle = "solid"; Array.from(node.children).map(function (child) { if (isCodeSpanOrLeaf(child)) { child.style.backgroundColor = "yellow"; @@ -71,6 +73,8 @@ function isCodeSpanOrLeaf(node) { function removeHighlighting(event, node) { event.stopPropagation(); node.style.backgroundColor = null; + node.style.outlineColor = null; + node.style.outlineStyle = null; Array.from(node.children).map(function (child) { if (isCodeSpanOrLeaf(child)) { child.style.backgroundColor = null;