From 0e25bec4e7a498eab9ea48194fb162be20e454f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Tue, 4 Oct 2022 15:42:14 +0100 Subject: [PATCH] fixed js bug on copy code module --- assets/js/code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/code.js b/assets/js/code.js index a41fb8b1..2cd3474d 100644 --- a/assets/js/code.js +++ b/assets/js/code.js @@ -1,6 +1,6 @@ var scriptBundle = document.getElementById("script-bundle"); -var copyText = scriptBundle ? scriptBundle.getAttribute("data-copy") : "Copy"; -var copiedText = scriptBundle ? scriptBundle.getAttribute("data-copied") : "Copied"; +var copyText = scriptBundle && scriptBundle.getAttribute("data-copy")? scriptBundle.getAttribute("data-copy") : "Copy"; +var copiedText = scriptBundle && scriptBundle.getAttribute("data-copied")? scriptBundle.getAttribute("data-copied") : "Copied"; function createCopyButton(highlightDiv) { const button = document.createElement("button");